Skip to content

Instantly share code, notes, and snippets.

@dkrnl
Last active December 29, 2016 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkrnl/5a94b956c676423c7c27abc7b2674861 to your computer and use it in GitHub Desktop.
Save dkrnl/5a94b956c676423c7c27abc7b2674861 to your computer and use it in GitHub Desktop.
SVN pre-commit: commit message required
#!/bin/sh
REPOS="$1"
TXN="$2"
export LANG="ru_RU.UTF-8"
SVNLOOK=/usr/bin/svnlook
LOGMSG=$($SVNLOOK log -t "$TXN" "$REPOS" | wc -m)
if [ "$LOGMSG" -lt 15 ];
then
echo "Error: commit message is less than 15 characters long" 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