Created
October 10, 2013 12:15
-
-
Save albburtsev/6917386 to your computer and use it in GitHub Desktop.
This file contains 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
❯ cat .git/hooks/prepare-commit-msg | |
#!/bin/bash | |
b=`git symbolic-ref HEAD| sed -e 's|^refs/heads/||' | sed -e 's|_.*||'` | |
c=`cat $1` | |
if [ -n "$b" ] && [[ "$c" != "[$b]:"* ]] | |
then | |
echo "[$b]: $c" > $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment