Skip to content

Instantly share code, notes, and snippets.

View Lacrymology's full-sized avatar

Tomas Neme Lacrymology

  • ShipHero LLC
  • Barcelona
View GitHub Profile
@Lacrymology
Lacrymology / commit-msg
Created May 17, 2016 13:01 — forked from henrik/commit-msg
Git commit-msg hook that automatically adds "Refs #123" when in the branch t123, "[#123]" when in the branch s123 etc.
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "t123", automatically
# adds "Refs #123." to commit messages unless they mention "#123" already.
# Include "#close" or "#finish" to add "Closes #123."
#
# For Pivotal Tracker, branch names like "s123" adds "[#123]".
# Include "#close" or "#finish" to add "[Finishes #123]".
#
# If you include "#noref" in the commit message, nothing will be added to