Created
June 25, 2012 16:56
-
-
Save tonyghita/2989861 to your computer and use it in GitHub Desktop.
git hook which prepends the branch name to the 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 | |
branchname = `git describe --contains --all HEAD` | |
message_file = ARGV[0] | |
message = File.read(message_file) | |
File.open(message_file, 'w') {|f| f.write branchname + message } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment