#!/bin/bash

# A pre-commit hook script to ensure that no changes are commited to the
# repository without a valid comment
#
# $Id: pre-commit 830 2006-05-08 00:20:06Z ram $

# arguments
REPO="$1"
TXN="$2"

# binary locations
SVNLOOK=/opt/local/bin/svnlook
GREP=/usr/bin/grep

# make sure that the log message contains some text.
$SVNLOOK log $REPO -t $TXN | $GREP '[[:alnum:]]' >> /dev/null
err=$?

if [ $err -ne 0 ]; then
	echo -n "Empty commit message, aborting" 1>&2
	exit 1
fi
