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