views:

719

answers:

3

I know somehow in Subversion you can ensure x chars when a developer commits in the comments section. I'm using Tortoise but don't see where to specify this globally and ensure that x number of characters will be entered on any commits made by developers. I'm using Visual SVN Server as well to setup repositories.

A: 

from the tortoise svn menu (explorer plugin) choose properties -> Add -> tsvn:logminsize

see also: http://www.anujgakhar.com/2008/07/22/forcing-svn-comments-with-tortoisesvn/

and

http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/ch05s15.html

EDIT Tormod is right - it is good to have that policy on the server, but I just "enforce" it on the clients. We basically have an svnprops file we propagate. If people don't adhere to it then we have some discussion...

Tim
Well if you want to enforce it on all your clients you'd have to have it set on the server!
CoffeeAddict
should not be a discussion, should be a standard thus you enforce x chars to be entered. IF you can't deal with a required comment, that's BS.
CoffeeAddict
There are some cases where comments might not be needed. We trust our developers to be smart about it. I am not saying it should not be on the server - what I am saying is that there is no 100% always correct rule. Where do you draw the line? How many characters? And why?
Tim
I draw the line at the fact that every commit should have a message so anyone looking at the history can tell wtf is going on without having to look at ALL code in the repository which would be an unreasonable start and which is why you have a history feature (comments) in subversion or any other source control to begin with! Even a small change has a purpose or underlying effect for the team!
CoffeeAddict
@coffeeaddict - that's nice - but can you tell me how many characters that is supposed to be? If I am going to make a rule on the server - like you advocate - how do i translate what you said (which I agree with) into a hard/fast rule? Is that 3 characters? 10? 25? 100? 200?
Tim
Just think about it. I think you know first off a sentence can't possibly make any sense without at least 100+ chars. You can't really form a detailed sentence with anything less for starters.
CoffeeAddict
I wouldn't want my developers to always just put in a sentence if there's more to be told either. The more detail the better especially if the set has a lot of changes in it.
CoffeeAddict
So the requirement being at least one detailed sentence to determine a base of x chars to start with.
CoffeeAddict
So you don't think just a link to a defect issue is enough, with perhaps three or four words? We disagree there. I find that perfectly acceptable in some cases - especially for trivial issues or other cases. For example: ["Fixed memory leak issue 1234 - delete pointer in dtor"] and note that with the integration of svn and some other tool there is a url/link to the issue that you can click on. That comment has half of your required 100 and is very detailed and specific.
Tim
If you "force" people to put in comments that long (and I have seen this happen) then people put in nonsense, or "blah blah" or ellipses or whatever. And then you are back to the same problem that you have with just putting that in the client.
Tim
+4  A: 

To be effective across an entire development team, this is a setting that should be set on the server, rather than in the TortoiseSVN clients. If you still wish to set this setting on the client, the setting that Tim refers to is illustrated in this blog post:
http://www.anujgakhar.com/2008/07/22/forcing-svn-comments-with-tortoisesvn/

Tormod Fjeldskår
doesn't really say how to set this on the server. I have seen that you must use hooks but there has to be an easier way and I have yet to find a hook that requires all developers to be prompted to enter x chars in for comments on pre-commit
CoffeeAddict
so how would you set this server-side? IF you have a hook you can share please do cause I can't find one on the net or in the docs.
CoffeeAddict
A: 

Here's an article on preventing blank comments. This one's on SO already

Jeremy
Ok, but where is that limiting per x chars? It just checks that you have entered a char.
CoffeeAddict
and that SO link does nothing to help me, just says to create a hook. I've found no good articles on how to do that in Windows hook files. It's not that easy or easy to find. I just want an example of someone who has already created this hook. Pain in the ass.
CoffeeAddict