阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

SVN提交内容时必须填写日志(输入字符)

246次阅读
没有评论

共计 1250 个字符,预计需要花费 4 分钟才能阅读完成。

自己在 Windows 上用 VisualSVN 搭了个服务器,默认提交代码是可以不填任何信息,这可不是我所期望的,于是找到了下面的解决方案:

在 VisualSVN 的管理控制台中可以设置这些规则,这些规则在特定的时机触发,其中 Commit 代码之前检查是否填写了 log 信息,我们可以在 pre-commit 时进行。

设置方法:
1、打开 VisualSVN 管理控制台
2、右键你要设置的代码仓库
3、所有任务 -》Manage Hooks……
4、编辑“Pre-commit hook”

添加如下代码

@echo off
::   
:: Stops commits that have empty log messages.
::

@echo off

set svnlook=”D:/Program Files/VisualSVN Server/bin/svnlook.exe”
setlocal

rem Subversion sends through the path to the repository and transaction id
set REPOS=%1
set TXN=%2

rem check for an empty log message
%svnlook% log %REPOS% -t %TXN% | findstr . > nul
if %errorlevel% gtr 0 (goto err) else exit 0

:err
echo. 1>&2
echo Your commit has been blocked because you didn’t give any log message 1>&2
echo Please write a log message describing the purpose of your changes and 1>&2
echo then try committing again. — Thank you 1>&2
exit 1

Ubuntu 14.04 下搭建 SVN 服务器 svn://  http://www.linuxidc.com/Linux/2015-01/111956.htm

CentOS 6.2 SVN 搭建 (YUM 安装) http://www.linuxidc.com/Linux/2013-10/91903.htm

CentOS 6.5 部署 Apache+SVN  http://www.linuxidc.com/Linux/2013-12/94315.htm

Apache+SVN 搭建 SVN 服务器 http://www.linuxidc.com/Linux/2013-03/81379.htm

Windows 下 SVN 服务器搭建和使用 + 客户端重新设置密码 http://www.linuxidc.com/Linux/2013-05/85189p5.htm

Ubuntu Server 12.04 安装 SVN 并迁移 Virtual SVN 数据 http://www.linuxidc.com/Linux/2013-05/84695.htm

Ubuntu Server 搭建 svn 服务以及迁移方法 http://www.linuxidc.com/Linux/2013-05/84693.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计1250字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中