Skip to content

Instantly share code, notes, and snippets.

@monkseal
Last active August 29, 2015 14:20
Show Gist options
  • Save monkseal/e8049b05be0712ea77ec to your computer and use it in GitHub Desktop.
Save monkseal/e8049b05be0712ea77ec to your computer and use it in GitHub Desktop.
Simple 'commit-msg' hook to reject commits that don't contain the issue number
#!/bin/sh
#
# This example tests that the commit message contains DS, exit 1 will fail the commit.
test "" != "$(grep '\[DS-[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