Last active
November 6, 2019 15:22
-
-
Save pgblu/ad72d22bf4228cacd658c3e9000390d5 to your computer and use it in GitHub Desktop.
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
# Usage: ruby commit-prepender this is my commit message without quotation marks | |
branch_name = %x.git rev-parse --abbrev-ref HEAD. | |
regex = Regexp.new(/[A-Z]*-[0-9]*/) | |
string_to_prepend = branch_name.match(regex).to_s | |
cmd = "git commit -m \"[#{string_to_prepend}] #{ARGV.join(" ")}\"" | |
`#{cmd} >&2` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment