首页 > 其他 > 详细

关于svn hooks拦截设置

时间:2016-03-17 19:37:10      阅读:308      评论:0      收藏:0      [点我收藏+]

这边公司svn需要设置拦截请求

1 设置必须注释至少5个字符才能提交

LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c`
if [ "$LOGMSG" -lt 5 ];
then
   echo -e "大哥你要写点注释啊,不然不能提交." 1>&2
   exit 1
fi
# All checks passed, so allow the commit.
exit 0

2 提交代码时,后缀不能有关键字

classPath|project|settings|idea|iml|class
# file filter: we only allow commit .c && .h files.
FILTER=‘\.(classPath|project|settings|idea|iml|class)$‘
files=$($SVNLOOK changed -t $TXN $REPOS | awk ‘{print $2}‘)
# check
for f in $files
do
    # check file type
    if echo $f | grep -Eq $FILTER ; then
        # valid file
        echo "File $f is a .classPath or .project or .settings or .idea or .iml or .class file" >> /dev/stderr
        exit 1
    fi
done
exit 0


本文出自 “熊仔的博客” 博客,请务必保留此出处http://9821177.blog.51cto.com/9811177/1752304

关于svn hooks拦截设置

原文:http://9821177.blog.51cto.com/9811177/1752304

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!