Laze

If I rest I rust !

  博客园  :: 首页  :: 新随笔  ::  ::  :: 管理
1. 重命名svn主目录中hooks的pre-commit.tmpl文件为pre-commit,并添加可执行权限
mv pre-commit.tmpl pre-commit  
chmod u+x pre-commit 
2. 编辑pre-commit文件
vi pre-commit  
# 注释这以下三行  
# $SVNLOOK log -t "$TXN" "$REPOS" | \   
# grep "[a-zA-Z0-9]" > /dev/null || exit 1  
# commit
-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1 # 在“# commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1”后添加
LOGMSG
=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 8 ] then echo -e "\nLog message cann't be empty! you must input more than 8 chars as comment!" 1>&2 exit 1 fi

注:一个汉字对应16个字符

 
posted on 2017-05-04 23:47  CollinTsui  阅读(333)  评论(0编辑  收藏  举报