Skip to content

Instantly share code, notes, and snippets.

@anytizer
Created March 10, 2014 09:07
Show Gist options
  • Save anytizer/9461728 to your computer and use it in GitHub Desktop.
Save anytizer/9461728 to your computer and use it in GitHub Desktop.
Pre-Commit script
#!/bin/sh
# http://blog.grimsy.net/2008/07/a-few-svn-pre-commit-hooks/
REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
SVNLOOKOK=1
$SVNLOOK log -t "$TXN" "$REPOS" | \
grep "[a-zA-Z0-9]" > /dev/null || SVNLOOKOK=0
if [ $SVNLOOKOK = 0 ]; then
echo Empty log messages are not allowed. Please provide a proper log message. 1>&2
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment