随笔 - 833  文章 - 1  评论 - 106  阅读 - 200万

如何设置SVN提交时必须输入注释(不少于2个字符)

在Windows环境

在SVN的Repositories路径,E:\Repositories\demo20170408\hooks;

创建pre-commit.bat批处理文件。

文件内容:

复制代码
复制代码
 1 @echo off
 2 set SVNLOOK="D:\Program Files\VisualSVN Server\bin\svnlook.exe"
 3 setlocal
 4 set REPOS=%1
 5 set TXN=%2
 6 rem check that logmessage contains at least 2 characters
 7 %SVNLOOK% log "%REPOS%" -t "%TXN%" | findstr ".." > nul
 8 if %errorlevel% gtr 0 goto err
 9 exit 0
10 :err
11 echo Empty log message not allowed. Commit aborted! 1>&2
12 exit 1
复制代码
复制代码

  

分类: svn

参考 https://www.cnblogs.com/zjiacun/p/6682710.html

原文中要求不少与10个字符,这里改成了2个(6,7行 findstr)

posted on   3D入魔  阅读(162)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2015-03-18 尝试使用Osg共享渲染描述表(HGLRC)实现多线程编译显示列表--总结
2015-03-18 给控件做数字签名之一:将控件打包为Web发布包 [转]
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示