Created
July 20, 2010 14:49
-
-
Save simonc/483050 to your computer and use it in GitHub Desktop.
commit-msg
This file contains 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 | |
file = ARGV.first | |
branch = `git br --no-color | grep '^*' | cut -d' ' -f2`.gsub(/ref-(\d+)-.*/, '\1').strip | |
open('/tmp/git_debug', 'a') { |f| f.puts branch } | |
msg = '' | |
if branch =~ /^\d+$/s | |
open(file, 'r') do |f| | |
msg = f.read | |
end | |
unless msg =~ /^Ref #/ | |
open(file, 'w') do |f| | |
f.puts "Ref ##{branch} : #{msg}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment