Created
November 17, 2021 09:07
-
-
Save acosonic/71c712eae5b12ba28e9e9e59a7d48478 to your computer and use it in GitHub Desktop.
Git pre-commit hook to check for valid Redmine commit message. Add this to .git/hooks/commit-msg and chmod to be executable
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/bash | |
# Add this to .git/hooks/commit-msg and chmod to be executable | |
# Author Aleksandar Pavic - buy my Redmine book - redmine cookbook | |
MSG="$1" | |
if ! grep -qE "refs \#[0-9].*" "$MSG";then | |
cat "$MSG" | |
echo "Valid comments needs to have refs #issueID 'refs # ID of Redmine ticket'" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment