Skip to content

Instantly share code, notes, and snippets.

@jirkapenzes
Created November 4, 2015 14:22
Show Gist options
  • Save jirkapenzes/66f7866c103a5cae5d75 to your computer and use it in GitHub Desktop.
Save jirkapenzes/66f7866c103a5cae5d75 to your computer and use it in GitHub Desktop.
Script to check Jira issue number in commit message
#!/bin/sh
#
# The hook check if commit message include jira ticket number.
# Example:
# Message: Refactoring (WEBAPI-100)
#
# Script location: .git/hooks/commit-msg
#
test "" != "$(grep '\(WEBAPI-[0-9]\+\)' "$1")" || {
echo >&2 "ERROR: Commit message is missing Jira issue number."
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment