SVN禁止删除和强制注释操作的钩子脚本 (Linux)
2016-08-24 10:44
393 查看
hooks/pre-commit (记得授权)
REPOS="$1" TXN="$2" SVNLOOK=/usr/bin/svnlook # Make sure that the log message contains some text. LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c` if [ "$LOGMSG" -lt 5 ]; then echo -e "nLog message cann't be empty! you must input more than 5 chars as comment!." 1>&2 exit 1 fi SCMLIST="huayu" C_USER=`$SVNLOOK info -t $TXN $REPOS | sed -n "1p"` if [ -z `echo $SCMLIST | grep $C_USER` ];then echo `$SVNLOOK changed -t $TXN $REPOS` > /svn/project/huayu/commit_log if cat /svn/project/huayu/commit_log|cut -d" " -f1|uniq -u|grep "^D";then echo "You do not have permisson to delete a file" > /dev/stderr rm -rf /svn/project/huayu/commit_log exit 1 fi fi #$SVNLOOK log -t "$TXN" "$REPOS" | \ # grep "[a-zA-Z0-9]" > /dev/null || exit 1 # 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
相关文章推荐
- 经验分享之SVN禁止删除和强制注释操作的钩子脚本pre-commit
- svn强制要求提交注释--pre-commit钩子
- svn强制要求提交注释--pre-commit钩子
- svn禁止删除权限和日志长度限制的脚本书写
- svn强制要求提交注释--pre-commit钩子
- Linux下使用SVN Hook钩子脚本实现SVN提交前校验
- svn强制要求提交注释--pre-commit钩子
- linux下关于svn提交的时候强制写注释
- 【转】svn强制要求提交注释--pre-commit钩子
- linux下面删除.svn文件脚本
- LINUX下 SVN 强制写LOG脚本
- svn强制添加注释脚本
- 在Linux和Windows下安装SVN钩子脚本
- svn强制要求提交注释--pre-commit钩子
- svn库自动归档到网站目录和提交svn时强制注释脚本
- svn强制添加注释脚本(windows版)
- svn在linux下的使用(svn命令行)删除 新增 添加 提交 状态查询 恢复等操作
- 【svn】 linux svn 强制提交注释
- linux强制svn提交时必须写注释
- svn强制要求提交注释--pre-commit钩子