svn提交强制注释_linux svn提交必须写中文注释

REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
#LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS"|grep "[a-zA-Z0-9]" |wc -c`
LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | tr -d ' ' | wc -c`
#LOGMSG=`$SVNLOOK log -t $TXN $REPOS | wc -m`

#$SVNLOOK log -t "$TXN" "$REPOS" | \

#   grep "[a-zA-Z0-9]" > /dev/null || exit 1


if [ "$LOGMSG" -lt 64 ];then
echo -e "Comment cann't be empty! You must input at least 64 characters or 5 Chinese characters!" 1>&2
exit 1
fi


# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
#commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1

# All checks passed, so allow the commit.

exit 0


注意:

1.一个汉字对应16个字符。

2.一定要添加文件权限



chmod +x pre-commit







你可能感兴趣的:(项目管理之版本管理)