r1 - 04 Aug 2008 - 09:10:28 - Main.yfangYou are here: YWiki >  Thesaurus Web > Svn提交强制写log

Svn提交强制写log

配置pre-commit文件 //此文件在用户每次更新库中都必须要求写log,此文以log最低5个字符为例

# cd /svnroot/test/hooks
# cp pre-commit.tmpl pre-commit
# vi pre-commit
在末尾删除原来的,添加上以下参数
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
# check that logmessage contains at least 5 alphanumeric characters
LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c`
if [ "$LOGMSG" -lt 5 ];
then
  echo -e "\nEmpty log message not allowed. Commit aborted!" 1>&2
  exit 1
fi
//[ "$LOGMSG" -lt 5 ] -lt 5这个5是至少为5个字符,请注意。
# chmod a+x pre-commit   //添加可执行权限给pre-commit
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by YWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding YWiki? Send feedback