如何在 VisualSVN 服务器中要求提交消息? [英] How to require commit messages in VisualSVN server?
问题描述
我们在 Windows 上将 VisualSVN 服务器设置为我们的 Subversion 服务器,并且我们使用 Ankhsvn + TortoiseSVN 作为我们工作站上的客户端.
如何配置服务器以要求提交消息非空?
VisualSVN Server 3.9 提供了 VisualSVNServerHooks.exe check-logmessage
预提交挂钩,可帮助您拒绝带有空或短日志消息的提交.有关说明,请参阅文章KB140:在 VisualSVN 服务器中验证提交日志消息.>
除了内置的 VisualSVNServerHooks.exe
,VisualSVN Server 和 SVN 一般使用一个 完成此类任务的钩子数量.
开始提交
— 在提交事务开始之前运行,可用于进行特殊权限检查预提交
— 在事务结束时运行,但在提交之前.通常用于验证非零长度日志消息等内容.提交后
— 在事务提交后运行.可用于发送电子邮件或备份存储库.pre-revprop-change
— 在修订属性更改之前运行.可用于检查权限.post-revprop-change
— 在修订属性更改后运行.可用于通过电子邮件发送或备份这些更改.
您需要使用 pre-commit
钩子.您几乎可以使用您的平台支持的任何语言自行编写它,但网络上有许多脚本.谷歌搜索svn precommit hook to require comment"我发现了一对看起来符合要求的夫妇:
We've got VisualSVN Server set up as our Subversion server on Windows, and we use Ankhsvn + TortoiseSVN as clients on our workstations.
How can you configure the server to require commit messages to be non-empty?
VisualSVN Server 3.9 provides the VisualSVNServerHooks.exe check-logmessage
pre-commit hook that helps you reject commits with empty or short log messages. See the article KB140: Validating commit log messages in VisualSVN Server for instructions.
Besides the built-in VisualSVNServerHooks.exe
, VisualSVN Server and SVN in general uses a number of hooks to accomplish tasks like this.
start-commit
— run before commit transaction begins, can be used to do special permission checkingpre-commit
— run at the end of the transaction, but before commit. Often used to validate things such as a non zero length log message.post-commit
— runs after the transaction has been committed. Can be used for sending emails, or backing up repository.pre-revprop-change
— runs before a revision property change. Can be used to check permissions.post-revprop-change
— runs after a revision property change. Can be used to email or backup these changes.
You need to use the pre-commit
hook. You can write it yourself in just about any language your platform supports, but there are a number of scripts on the web. Googling "svn precommit hook to require comment" I found a couple that looked like they would fit the bill:
这篇关于如何在 VisualSVN 服务器中要求提交消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!