问题描述
我们已在Windows上将VisualSVN Server设置为我们的Subversion服务器,并在工作站上使用Ankhsvn + TortoiseSVN作为客户端.
如何配置服务器以要求提交消息为非空?
VisualSVN Server 3.9提供了VisualSVNServerHooks.exe check-logmessage
预提交钩子,可帮助您拒绝带有空日志或简短日志消息的提交.有关说明,请参见文章 KB140:在VisualSVN Server中验证提交日志消息. >
除了内置的VisualSVNServerHooks.exe
,VisualSVN Server和SVN通常使用数量的钩子来完成这样的任务.
-
start-commit
—在提交事务之前运行开始,可用于进行特殊权限检查 -
pre-commit
–最后运行交易,但在提交之前.通常用于验证诸如非零长度日志消息之类的内容. -
post-commit
—在交易之后运行已承诺.可用于发送电子邮件或备份存储库. -
pre-revprop-change
—运行之前修订版属性更改.可用于检查权限. -
post-revprop-change
—运行在修订版属性更改.可用于通过电子邮件发送或备份这些更改.
您需要使用pre-commit
挂钩.您可以使用平台支持的几乎任何语言自己编写代码,但是网络上有许多脚本.谷歌搜索"svn precommit hook需要评论",我发现一对夫妇看起来很合适:
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服务器中要求提交消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!