Skip to content

Instantly share code, notes, and snippets.

@claudiob
Created August 8, 2013 19:10
Show Gist options
  • Save claudiob/6187713 to your computer and use it in GitHub Desktop.
Save claudiob/6187713 to your computer and use it in GitHub Desktop.
At Topspin, we use the Pivotal Tracker ticket number in the name of the git branch assigned to that feature, e.g. 12345-feature. However, this format does not work for Pivotal/Github hooks, which require this text in the commit message: [#12345] feature If you just add the following gist in .git/hooks/prepare-commit-msg then the integration betw…
#!/bin/sh
#
case "$2,$3" in
merge,)
original_message=$(<$1)
echo $original_message | sed -e "s/^Merge branch '\([[:digit:]]*\)-/[#\1] &/" > $1 ;;
*) ;;
esac
@mdurn
Copy link

mdurn commented Aug 8, 2013

I've been wanting this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment