Created
February 23, 2012 19:16
-
-
Save jbgo/1894447 to your computer and use it in GitHub Desktop.
Git hook to require a PT story# in your commit message
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
#!/usr/bin/env ruby | |
unless File.new(ARGV.first).read =~ /\[#\d+/ | |
puts "Commit aborted! Missing reference to Pivotal Tracker story in commit message. (e.g. [#12345])" | |
exit 1 | |
end |
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
cd ~/your/project | |
curl https://raw.github.com/gist/1894447/5a3d055690916cd4dadc6be0aec7881242e15c33/commit-msg > .git/hooks/commit-msg | |
chmod +x .git/hooks/commit-msg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment