我似乎对此毫无进展。 要么在网上搜索脚本,等等。任何人都可以获得一个脚本,您可以在 Windows 环境中编辑开箱即用的 pre-commit.tmpl,该脚本需要输入 x 字符以对 Tortoise Subversion 中的提交进行评论全局,以便团队中的所有成员都需要,而此要求从 SVN 服务器推送到客户端?
我不知道脚本语言,这应该是非常简单的事情,不需要我花时间去弄清楚接下来 3 小时的脚本。
I seem to be getting nowhere with this. Either searching the web for a script, etc. Anyone got a script that you can just edit the out-of-box pre-commit.tmpl in a Windows environment that requires x chars to be entered in for a comment on commit in Tortoise Subversion globally so that all members on the team are required whereas this requirement is pushed down to the clients from SVN server?
I don't know the scripting language and this should be something pretty damn simple without me taking the time to figure out scripting for the next 3 hours.
发布评论
评论(5)
这是一个 .bat 文件,需要有注释。 它检查注释中是否至少存在一个字符。
该文件位于存储库的 /hooks 文件夹中,名为 pre-commit.bat。 如果您需要最少数量的字符,则要修改的行是
因此,如果您需要最少 10 个字符,则需要有 10 个 .,而不仅仅是 1 个
更多 findstr 命令的高级选项将让您进行更高级的检查(某些字符集等)
This is a .bat file to require there is a comment. It checks for the existence of at least one character in the comment.
This file sits in the /hooks folder of the repository, named pre-commit.bat. If you need a minimum amount of characters, the line to modify is
So if you wanted a minimum of 10 characters, you need to have 10 .'s rather than just one
More advanced options for the findstr command will let you do fancier checks (certain character sets, ect)
我使用 SubversionNotify,它的功能可能超出您的需要,但设置起来非常简单。
I use SubversionNotify, it probably does more than what you need, but is pretty simple to set up.
我有一个预提交挂钩,它可以完全满足您的需求。 还有更多。
它还允许您执行以下操作:
svn cp
添加目录,但不能提交任何更改。 这非常适合/tags
目录,您可以在其中创建标签,但不能修改标签。而且,它还允许您执行以下操作:
svn:ignore
等事情非常有用,这样用户就不会意外提交他们应该提交的文件。 t 提交。svn:log
必须匹配某些正则表达式。该预提交脚本是用 Perl 编写的。 默认情况下,Perl 附带 Unix、Mac 和 Linux 服务器。 不幸的是,它不包含在 Windows 计算机上。 幸运的是,有几个开源、免费且易于安装的 PC Perl 软件包,例如 ActivePerl 和 Strawberry Perl
I have a pre-commit hook that can do exactly what you want. Plus a lot more.
It also allows you to do the following:
svn cp
, but not commit any changes. This is perfect for the/tags
directory where you are allowed to make a tag, but not modify the tag.And, it also allows you to do this:
svn:ignore
is set, so users don't accidentally commit in files they shouldn't commit.svn:log
must match certain regular expressions.This pre-commit script is written in Perl. By default, Perl comes with Unix, Mac, and Linux servers. Unfortunately, it isn't included on Windows computers. Fortunately, there are several open source, free, and easy to install Perl packages for the PC such as ActivePerl and Strawberry Perl
在 Windows 上,您可以使用 VisualSVN Server 附带的
VisualSVNServerHooks.exe check-logmessage
预提交挂钩,该挂钩位于%VISUALSVN_SERVER%bin
目录中。 这个简单的工具将帮助您定义日志消息中允许的最小字符数。有关说明,请参阅文章 KB140:验证 VisualSVN 服务器中的提交日志消息。
On Windows, you can use the
VisualSVNServerHooks.exe check-logmessage
pre-commit hook that comes with VisualSVN Server and is located in the%VISUALSVN_SERVER%bin
directory. This simple tool will help you define the minimum allowed number of characters in the log message.See the article KB140: Validating commit log messages in VisualSVN Server for instructions.
尝试这个 :
Try this :