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


#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

完成


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM