Last active
August 29, 2015 14:20
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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