Skip to content

Instantly share code, notes, and snippets.

@flyerhzm
Created June 25, 2011 09:51
Show Gist options
  • Save flyerhzm/1046324 to your computer and use it in GitHub Desktop.
Save flyerhzm/1046324 to your computer and use it in GitHub Desktop.
git commit-msg hook to promise containing jira ticket
###################################################################################
# please add the following codes to .git/hooks/commit-msg, make it be an executable
###################################################################################
#!/usr/bin/env ruby
commit_message = File.read ARGV[0]
unless commit_message =~ /ENGINEERING-\d+/
puts "ERROR: please add jira ticket on git commit message"
exit(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment