Creating a Required Comment Hook for Tortoise SVN
Asked Answered
P

3

4

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.

Pearlinepearlman answered 30/7, 2009 at 19:44 Comment(0)
M
4

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

enter image description here

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).

enter image description here

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

Mears answered 27/4, 2014 at 2:27 Comment(0)
F
1

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

Fermentative answered 30/7, 2009 at 19:50 Comment(5)
hehe, trust developers to add a rule to enforce them to submit with comments! yea I wish the world was that simple and people were that dedicated and professional. :)Pearlinepearlman
that is a perl script. I'm using Tortoise SVN on a windows Vista environment locally and Windows Server 2007 on our dev server.Pearlinepearlman
I started reverting people's changes when they had no comments. That went a long way to letting them know I was serious. Sometimes comments are not necessary, sometimes a word or two is sufficient, but most times more is needed.Fermentative
it's nice when you have that power, but most don't.Pearlinepearlman
SO you have the authority to put on a server side script, but not revert?Fermentative
C
0

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.

Cos answered 13/10, 2015 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.