先备份pre-commit.tmpl为pre-commit.tmpl.back。
然后修改pre-commit.tmpl名字为pre-commit。 切记设置执行权限。
#!/bin/sh
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook #根据你的SVN目录而定
LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c`
if [ "$LOGMSG" -lt 10 ];
then
echo "Log message can't be empty! you must input more than 10 chars as comment!." 1>&2
exit 1
fi