Skip to content

Instantly share code, notes, and snippets.

@adithyakhamithkar
Forked from opyate/commit-msg
Created January 3, 2018 11:05
Show Gist options
  • Save adithyakhamithkar/e2c425b547d92f5a52dac223e3f0280b to your computer and use it in GitHub Desktop.
Save adithyakhamithkar/e2c425b547d92f5a52dac223e3f0280b to your computer and use it in GitHub Desktop.
JIRA code commit msg hook; presumes merges happen on remote (via PR mechanism, etc)
#!/bin/sh
# .git/hooks/commit-msg
test "" != "$(egrep '[A-Z]{3,}-\d+' "$1")" || {
echo >&2 Commit message requires JIRA code.
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment