Skip to content

Instantly share code, notes, and snippets.

@rochefort
Created January 8, 2013 13:51
Show Gist options
  • Save rochefort/4483976 to your computer and use it in GitHub Desktop.
Save rochefort/4483976 to your computer and use it in GitHub Desktop.
git commit時にticket noを必須にする
# .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