Created
April 6, 2013 06:27
-
-
Save alisaifee/5325119 to your computer and use it in GitHub Desktop.
post-checkout script to print the jira summary for the branch you're on if its named with a jira or the summary of the jira of the last commit on that branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import sys | |
import re | |
branch_name = os.popen("git svn info | grep URL | awk -F '/' '{print $NF}'").read() | |
expr = re.compile("([A-Z]+-[0-9]+)") | |
if expr.findall(branch_name): | |
jira = expr.findall(branch_name)[0] | |
os.system("jira-cli --oneline %s" % jira) | |
else: | |
last_commit = os.popen("git log -n 1 --format='%s'").read() | |
if expr.findall(last_commit): | |
jira = expr.findall(last_commit)[0] | |
os.system("jira-cli --oneline %s" % jira) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment