svn 强制添加注释
时间:2010-11-02 来源:jack_sir
在svn版本库中hooks目录下面:
sudo cp pre-commit.tmpl pre-commit
将pre-commit中的内容注释掉、添加如下内容:
REPOS="$1" TXN="$2"
SVNLOOK=/usr/bin/svnlook
LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 5 ]; then echo "Log message cann't be empty! you must input more than 5 chars as comment!." 1>&2 exit 1 fi
exit 0
保存退出后,并添加执行的权限:
suod chmod a+x pre-commit
sudo cp pre-commit.tmpl pre-commit
将pre-commit中的内容注释掉、添加如下内容:
REPOS="$1" TXN="$2"
SVNLOOK=/usr/bin/svnlook
LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 5 ]; then echo "Log message cann't be empty! you must input more than 5 chars as comment!." 1>&2 exit 1 fi
exit 0
保存退出后,并添加执行的权限:
suod chmod a+x pre-commit
相关阅读 更多 +