vim /svn/test/hooks/pre-commit (权限755)
打开已下注释
REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/alidata/subversion/bin/svnlook
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
其中
if [ "$LOGMSG" -lt 10 ];
表示日志信息少于10个字符时 退回提交
中英文有别chars