Skip to content

Instantly share code, notes, and snippets.

@joshgo
Created November 20, 2013 17:21
Show Gist options
  • Save joshgo/7567188 to your computer and use it in GitHub Desktop.
Save joshgo/7567188 to your computer and use it in GitHub Desktop.
SVN Pre-Commit script
REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null
GREP_STATUS=$?
if [ $GREP_STATUS -ne 0 ]
then
echo "Please enter a log message !!!" 1>&2
exit 1
fi
# Exit on all errors.
# set -e
# All checks passed, so allow the commit.
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment