如何设置SVN版本控制工具必须写注释才能提交
1个回答
展开全部
2,mv ./hooks/pre-commit.tmpl ./hooks/pre-commit 将代码仓库根目录下,hooks文件夹中的pre-commit.tmpl文件重命名为pre-commit
3,vim ./hooks/pre-commitREPOS=$1TXN=$2
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t $TXN $REPOS | /
grep [a-zA-Z0-9] /dev/null || exit 1
# Exit on all errors.set -e
# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
$REPOS/hooks/commit-access-control.pl $REPOS $TXN /
$REPOS/hooks/commit-access-control.cfg
# All checks passed, so allow the commit.exit 0
上面是修改前的,看一下,下面的,修改后的。REPOS=$1TXN=$2
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
LOGMSG=`$SVNLOOK log -t $TXN $REPOS | wc -m` //定义个变量,注意这里不是单引号
#$SVNLOOK log -t $TXN $REPOS | / //把这一行和下面的一行注释掉
# grep [a-zA-Z0-9] /dev/null || exit 1
echo $LOGMSG /home/administrator/www/aaa.txt //为了测试变量用的,查看$LOGMSG有没有值,最后要注释掉
echo /n至少输入4个汉字 &2 //必须填四个汉字exit 1fi
# Exit on all errors.#set -e
# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
#$REPOS/hooks/commit-access-control.pl $REPOS $TXN / /
/把这一行和下面的一行注释掉。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询