Skip to content

Instantly share code, notes, and snippets.

@pmoran
Created November 3, 2011 10:37
Show Gist options
  • Save pmoran/1336228 to your computer and use it in GitHub Desktop.
Save pmoran/1336228 to your computer and use it in GitHub Desktop.
Git hook to make sure commit message contains stream identifier
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file)
$regex = /^\[(Extranet|API|Consumer)\]/
if !$regex.match(message)
puts "COMMIT FAILED: your message doesn't start with [Extranet], [API] or [Consumer]"
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment