在库下的hooks目录里,创建脚本pre-commit,内容为:
#!/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