Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
add refs #xxx to commit message
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file)
branch = `git branch`.scan(/\* (.*)/).flatten[0]
exit 0 if branch == "master"
issue_no = branch.scan(/(\d{3,})/).flatten[0]
exit 0 if issue_no.nil?
message = "#refs ##{issue_no} \n" + message unless message.match("refs #")
File.open(message_file, "w") do |file|
file.write message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.