Skip to content

Instantly share code, notes, and snippets.

@opyate
Created October 10, 2017 09:33
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save opyate/d6b8b728edc16a3e4e185b78d26d4b0b to your computer and use it in GitHub Desktop.
Save opyate/d6b8b728edc16a3e4e185b78d26d4b0b 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