
如何设置SVN版本控制工具必须写注释才能提交
1个回答
展开全部
2,mv ./hooks/pre-commit.tmpl ./hooks/pre-commit 将代码仓库根目录下,hooks文件夹中的pre-commit.tmpl文件重命名为pre-commit
3,vim ./hooks/pre-commitREPOS="$1"TXN="$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="$1"TXN="$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有没有值,最后要注释掉
#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 \ //把这一行和下面的一行注释掉。

2025-03-12 广告
AD账户批量创建工具是河南九维网络科技有限公司针对Active Directory(AD)环境设计的高效管理工具。该工具能够简化用户账号的批量创建流程,大幅提高管理员的工作效率。通过导入包含用户信息的文件,管理员可以快速创建多个用户账号,同...
点击进入详情页
本回答由小鹿管家提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询