歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> SVN強制提立添加注釋

SVN強制提立添加注釋

日期:2017/3/1 17:08:29   编辑:關於Linux

SVN強制提立添加注釋 利用svn的pre-commit鉤子可簡單實現此要求。 www.2cto.com 進入倉庫hooks目錄,找到pre-commit.tmpl文件,重命名,去掉後綴.tmpl。 編輯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 這三行注釋掉(前面加#符號), 在此位置添加如下幾行: www.2cto.com LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 5 ];#要求注釋不能少於5個字符,您可自定義 then echo -e "nLog message cann't be empty! you must input more than 5 chars as comment!." 1>&2 exit 1 fi 最後別忘了加上執行權限.
Copyright © Linux教程網 All Rights Reserved