Created
January 8, 2013 13:51
-
-
Save rochefort/4483976 to your computer and use it in GitHub Desktop.
git commit時にticket noを必須にする
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
| # .git/hooks/commit-msg | |
| #!/usr/bin/env ruby | |
| msg_file = ARGV[0] | |
| msg = File.read(msg_file) | |
| unless (/(refs|fixes) \#(\d+)/).match(msg) | |
| puts "Your message is not formatted correctly (missing refs #XXX or fixes #XXX)" | |
| exit 1 | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment