Does anyone have a git commit hook I can use that will ensure a JIRA issue number appears in the checkin message? I've got no experience driving JIRA from a git commit hook so any help would be appreciated -- working source even more so!
First, make the hook executable:
chmod a+x .git/hooks/commit-msg
Append the following lines, substituting PROJECT with your project's code.
test "" != "$(grep 'PROJECT-' "$1")" || {
echo >&2 "ERROR: Commit message is missing Jira issue number."
exit 1
}