svn强制commit写log
https://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-howto-minlogmsgsize.html
Force users to enter a log message
There are two ways to prevent users from committing with an empty log message. One is specific to TortoiseSVN, the other works for all Subversion clients, but requires access to the server directly.
Hook-script on the server
If you have direct access to the repository server, you can install a pre-commit hook script which rejects all commits with an empty or too short log message.
In the repository folder on the server, there's a sub-folder hooks
which contains some example hook scripts you can use. The file pre-commit.tmpl
contains a sample script which will reject commits if no log message is supplied, or the message is too short. The file also contains comments on how to install/use this script. Just follow the instructions in that file.
This method is the recommended way if your users also use other Subversion clients than TortoiseSVN. The drawback is that the commit is rejected by the server and therefore users will get an error message. The client can't know before the commit that it will be rejected. If you want to make TortoiseSVN have the OK button disabled until the log message is long enough then please use the method described below.
Project properties
TortoiseSVN uses properties to control some of its features. One of those properties is the tsvn:logminsize
property.
If you set that property on a folder, then TortoiseSVN will disable the OK button in all commit dialogs until the user has entered a log message with at least the length specified in the property.
For detailed information on those project properties, please refer to the section called “Project Settings”.
具体操作
# On a Windows system, you should name the hook program
# 'pre-commit.bat' or 'pre-commit.exe',
# but the basic idea is the same.
需要注意的是, pre-commit.tmpl仅存在于具体的svn的repository中,并不存在于visual svn server的安装目录下。
直接使用everything,搜索pre-commit。然后按照文件内的说明,重命名为bat文件。结果发现默认的不能用
找到如下的脚本,直接将内容复制,然后覆盖原来的内容
https://stackoverflow.com/questions/1928023/how-can-i-prevent-subversion-commits-without-comments
You can use a hook (put it into <repository>/hooks
and name it pre-commit.bat
(Windows)):
@echo off
::
:: Stops commits that have empty log messages.
:: 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
src: http://www.anujgakhar.com/2008/02/14/how-to-force-comments-on-svn-commit/
遇到问题'svnlook' is not recognized as an internal or external command,
1.把这个目录配置到环境变量
C:\Program Files (x86)\VisualSVN Server\bin
2.然后重启VisualSvnServer这个windows service
如果svn的repository太多的话,可以写一个脚本,来自动复制pre-commit.bat
http://kockerbeck.blogspot.com/2010/08/require-comment-message-on-all-svn.html
@ECHO OFF
:: ------ SVN Deploy Hooks ------
:: ----- by Mark Kockerbeck ---- :: ------ Configuration ---------
SET HookDirectory=C:\CommonHooks
SET RepositoryDirectory=C:\Repositories
:: ------ /Configuration -------- pushd %HookDirectory%
for /r %%i in (*) do (
for /D %%j in (%RepositoryDirectory%\*) do (
echo Copying %%i to %%j\hooks\
copy %%i %%j\hooks\
)
)
popd
svn强制commit写log的更多相关文章
- SVN设置没有写log不能commit
操作方法:在SVN的Repositories下,找到要配置的项目,在项目目录下找到hooks文件夹,在其下创建pre-commit.bat文件,把下面复制进去就可以了(无需重启,如果改动,保存bat文 ...
- CentOS下的svn强制用户提交时写日志
问题:在项目提交时候不写日志,在后期查看修改历史时需要对比版本才知道提交原因.解决方案:在svn服务端通过hooks在提交时强制要求写日志.#!/bin/shREPOS="$1"T ...
- CentOS SVN强制用户提交时写日志
问题:在项目提交时候不写日志,在后期查看修改历史时需要对比版本才知道提交原因.解决方案:在svn服务端通过hooks在提交时强制要求写日志.#!/bin/shREPOS="$1"T ...
- svn 强制用户添加注释 和 允许用户修改注释
当我们用TortoiseSVN提交代码时,有很多人不喜欢写注释,导致以后代码版本多,也不清楚哪个版本到底改了什么东西.所以在提交的时候,我会强制要求添加注释.这是如何实现的?这个话题就涉及到了svn的 ...
- svn强制加注释才能提交
进入库的hooks目录下 cp pre-commit.tmpl pre-commit 并对pre-commit加入运行权限 修改pre-commit内容如下 REPOS="$1" ...
- 关于Quartz.NET作业调度框架的一点小小的封装,实现伪AOP写LOG功能
Quartz.NET是一个非常强大的作业调度框架,适用于各种定时执行的业务处理等,类似于WINDOWS自带的任务计划程序,其中运用Cron表达式来实现各种定时触发条件是我认为最为惊喜的地方. Quar ...
- 基于.Net Framework 4.0 Web API开发(3):ASP.NET Web APIs 异常的统一处理Attribute 和统一写Log 的Attribute的实现
概述: ASP.NET Web API 的好用使用过的都知道,没有复杂的配置文件,一个简单的ApiController加上需要的Action就能工作.但是项目,总有异常发生,本节就来谈谈API的异常 ...
- Java 写 Log
. 一个最基本的例子 使用Logging框架写Log基本上就三个步骤 引入loggerg类和logger工厂类 声明logger 记录日志 下面看一个例子 //1. 引入slf4j接口的Logger和 ...
- Subversion代码提交中的org.apache.subversion.javahl.ClientException: svn: E200007: Commit failed异常解决
: 在切换subversion服务器地址之后,发生的无法正确提交代码的问题org.apache.subversion.javahl.ClientException: svn: E200007: Com ...
随机推荐
- 回声状态网络(ESN)基础教程
http://jlearning.cn/2017/05/29/ESN-basic-tutorial/ 最近在看回声状态网络(Echo State Network)的内容,注意到中文搜索引擎搜不到关于有 ...
- 网关绑定命令,解决arp攻击
一般家里的宽带都采用ADSL设备,通过固定IP地址接入Internet,但是经常会出现断网的现象,那么如何通过ARP命令绑定默认网关来解决这个问题呢? 工具/原料 ARP命令 CMD命令提示符 方法/ ...
- 20165305 苏振龙《Java程序设计》第八周课上测试补做
1. 下载附件中的world.sql.zip, 参考http://www.cnblogs.com/rocedu/p/6371315.html#SECDB,导入world.sql,提交导入成功截图 2. ...
- 这份书单,给那些想学Hadoop大数据、人工智能的人
一.简单科普类 (文末附下载链接) 1.<人工智能:李开复谈AI如何重塑个人.商业与社会的未来图谱2> 作者:李开复,王咏刚 推荐理由:文章写得一般,但李开复和王永刚老师总结的还可以,算国 ...
- Lucene 个人领悟 (一)
在上学的时候就对搜索有着极大地兴趣,图书馆也借了好多的书看过,也用过Python写过爬虫. 有好多人在初步学习Lucene的时候都以为他是一个搜索引擎,或者搜索工具. 在此我要特别强调一下,Lucen ...
- Music life
some songs: you are you are <<你眼中的世界> Trouble I'm In > 1:40 secs 忧桑钢琴曲 < 豆花之歌 The Tru ...
- Step7:SQL Server 多实例下的复制
一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 搭建步骤(Procedure) 注意事项(Attention) 二.背景(Contexts) ...
- pat 团体赛练习题集 L2-007. 家庭房产
给定每个人的家庭成员和其自己名下的房产,请你统计出每个家庭的人口数.人均房产面积及房产套数. 输入格式: 输入第一行给出一个正整数N(<=1000),随后N行,每行按下列格式给出一个人的房产: ...
- 关于js浅拷贝与深拷贝的理解
前端开发中,一般情况下,很少会去在意深拷贝与浅拷贝的关系. 大家知道,js变量有2种数据类型:基本类型和引用类型.基本类型的拷贝是将整个值完全拷贝一份的,也就是深拷贝.就是开辟了新的堆内存.所以基本类 ...
- Oracle之用户和表空间
用户和表空间 看具体下载什么来操作?(oracle 11g,终端) 如果不在虚拟桌面, 它在整个总账项目里占什么位置? 如何使用? 不管学什么都要及时复习和总结,很重要. 增删改查 decode ...