CentOS7 Setting SVN pre-commit hook@[Langzidanxin]
-
Marked the following two lines:
1.1 #$SVNLOOKlog−t"SVNLOOK log -t "SVNLOOKlog−t"TXN" “$REPOS” |
grep “[a-zA-Z0-9]” > /dev/null || exit 11.2 #commit-access-control.pl “REPOS""REPOS" "REPOS""TXN” commit-access-control.cfg || exit 1
-
Add the following codes:
LOGMSG=$SVNLOOK log -t "$TXN" "$REPOS" | sed 's/[[:space:]]//g' | wc -c
if [ ${LOGMSG} -lt 8 ]; then #注意[]两边必须有空格
echo “Commit policy: You must write more than 8 chars as comment!” 1>&2
exit 1
fi
本文介绍了如何在 CentOS7 系统中设置 SVN 的 pre-commit 钩子,以实现对提交注释的长度检查。通过`SVNLOOK log-t`获取提交信息并使用正则表达式过滤,确保注释至少包含8个字符。同时,还引入了 `commit-access-control.pl` 脚本来进行更深入的权限控制,确保提交过程的安全性和合规性。
1341

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



