您的位置:首页 > 其它

svn 要求commit提交必须加注释(日志) hook

2016-12-23 16:27 357 查看
#vim /data/svn/mysvn/hook/pre-commit

#!/bin/bash
REPOS="$1"
TXN="$2"
#RES="OK"
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS"|grep "[a-zA-Z0-9]" |wc -c`
if [ "$LOGMSG" -lt 11 ];then
echo -e "Please input at least 10 character" 1>&2
exit 1
fi
#$SVNLOOK log -t "$TXN" "$REPOS" \
#| egrep "[^[:space:]]+" >/dev/null || unset RES
#if [ "$RES" != "OK" ] ; then
# echo "You must input some comments for you commit" 1>&2
# exit 1
#fi
# All checks passed, so allow the commit.
exit 0

添加完脚本 chmod +x /data/svn/mysvn/hook/pre-commit

完成
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: