svn强制用户提交时写日志

#!/bin/sh

REPOS="$1"

TXN="$2"

 

SVNLOOK=/usr/bin/svnlook #根据你的SVN目录而定

 

LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c`

if [ "$LOGMSG" -lt 10 ];

then

    echo "Log message can't be empty! you must input more than 10 chars as comment!." 1>&2

    exit 1

fi

  把上面代码保存为pre-commit,并设置权限为755,将此文件放置在SVN下库的hooks目录下,如:/svn/test/hooks

你可能感兴趣的:(SVN)