Skip to content

Instantly share code, notes, and snippets.

@Martiusweb
Created January 11, 2017 10:20
Show Gist options
  • Save Martiusweb/ec3cd29d82d4b6cd2ffb8eb57f2304ec to your computer and use it in GitHub Desktop.
Save Martiusweb/ec3cd29d82d4b6cd2ffb8eb57f2304ec to your computer and use it in GitHub Desktop.
git hook: Grep for a JIRA ticket ID in a commit message
#!/bin/sh
gtest "" = "$(grep '[A-Z]\+-[0-9]\+' "$1")" && {
echo >&2 "Sorry, I can't find a JIRA ticket ID in this commit message"
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment