Last active
October 18, 2017 13:03
-
-
Save acosonic/f3cb240756912216655ed2d35e5298fb to your computer and use it in GitHub Desktop.
Svn pre-commit hook requiring Redmine's issue id to be referenced with # as described in Redmine Cookbook a book by Packt Publishing
This file contains 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 script requires you to have svnlook installed (update it's location on line 5, if required...) | |
REPOS="$1" | |
TXN="$2" | |
SVNLOOK=/usr/bin/svnlook | |
LOGMSG=$($SVNLOOK log -t "$TXN" "$REPOS" | grep -e "refs #" -e "production" | wc -c) | |
if [ "$LOGMSG" -le 0 ]; then echo "Valid comments needs to have refs #issueID." 1>&2 | |
exit 1 | |
fi | |
# Exit on all errors. | |
set -e | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment