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" | \
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.
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
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.一定要添加文件权限


该博客介绍了如何在Linux环境下设置SVN提交时必须添加中文注释,通过创建并配置pre-commit钩子脚本来实现这一功能。内容包括检查注释是否包含字母数字字符以及赋予脚本执行权限。
最低0.47元/天 解锁文章
245

被折叠的 条评论
为什么被折叠?



