在svn版本库的hooks文件夹下面,复制模版pre-commit.tmplcp pre-commit.tmpl pre-commitchmod +x pre-commitvi编辑,如下:#!/bin/sh#必须填写注释且不少于5个字REPOS="$1"TXN="$2"# Make sure that the log message contains some text.SVNLOOK=/usr/bin/svnlookLOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 5 ];#要求注释不能少于5个字符,您可自定义 then echo -e "注释信息不能为空且不少于5个字!" 1>&2 exit 1 fiexit 0