问题
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