Creating a Required Comment Hook for Tortoise SVN

旧时模样 提交于 2019-12-12 18:26:27

问题


Has anyone implemented a hook that requires developers to input x chars before successful submission? I've looked up hooks but don't really understand how to implement this one for Subversion using Tortoise specifically for a Windows Environment.


回答1:


Simply right-click the top level of your Repository. In the context-menu select TortoiseSVN, then Properties, to see this dialog:

Click the New button near the bottom right, and select Log Sizes. Enter the number of characters you want to require for Commit and Lock (10 in example below).

Do a Commit from the top Level directory you just modified. Now your repository requires all users to Comment before Committing changes.




回答2:


Try this which was taken from here

Note that using client side commit requirements can work as well if you have developers you trust.

EDIT:

Then try this? http://svn.haxx.se/users/archive-2006-05/0594.shtml http://blog.tfanshteyn.com/2007/11/subversion-pre-commit-hooks.html




回答3:


If you are using JIRA together with Subversion, then use the Commit Policy add-on.

It can verify the number of characters in the commit messge with the condition named Commit message must match a pattern. Even better you can use a regex like this to count only the non-whitespace characters:

(?:\S|\S\s*){10,}

The add-on allows keeping all these rules in a central place (JIRA) and it offers several other conditions to check the committer person, the committed files and so on.

Disclaimer: this is a commercial add-on, and I'm a developer working on it.



来源:https://stackoverflow.com/questions/1208900/creating-a-required-comment-hook-for-tortoise-svn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!