Skip to content

Instantly share code, notes, and snippets.

@rajeshkumaravel
Forked from opyate/commit-msg
Created April 24, 2020 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajeshkumaravel/0f558d944a5bf24856affafcfc86e995 to your computer and use it in GitHub Desktop.
Save rajeshkumaravel/0f558d944a5bf24856affafcfc86e995 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