Created
June 19, 2012 16:55
-
-
Save norrs/2955246 to your computer and use it in GitHub Desktop.
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
rockj@pandora:/tmp/foo$ .git/hooks/commit-msg.sample /tmp/commitmsg.txt | |
rockj@pandora:/tmp/foo$ .git/hooks/commit-msg.sample /tmp/bad-commitmsg.txt | |
Requires valid ticket number | |
rockj@pandora:/tmp/foo$ cat .git/hooks/commit-msg.sample | |
#!/bin/sh | |
test "" = "$(head -1 "$1" | grep -vE ^[[:alpha:]]\{2,3}-[[:digit:]]\{1,3})" || { | |
echo >&2 Requires valid ticket number | |
exit 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment