Skip to content

Instantly share code, notes, and snippets.

@timurista
Created February 15, 2018 15:50
Show Gist options
  • Save timurista/e46080fe8660a5644013d2b6ebe98c17 to your computer and use it in GitHub Desktop.
Save timurista/e46080fe8660a5644013d2b6ebe98c17 to your computer and use it in GitHub Desktop.
grabs ticket and jira name
s=`git rev-parse --abbrev-ref HEAD | awk '{print toupper($0)}'`
JIRA_TYPE=` echo $s | rev | cut -d'-' -f2 | rev`
TICKET=`echo $s | rev | cut -d'-' -f1 | rev`
# call git with the message
echo [$JIRA_TYPE-$TICKET] $@
# git cmp = "!f() { git add -A && git commit -m \"$@\" && git push; }; f"
git cmp "[$JIRA_TYPE-$TICKET] $@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment