tags:

views:

506

answers:

5

I guess I'm really after an aid to help people who forget, Cruise Control sends out the details of commits to everyone, so people are keen to add a meaningful comment, but sometimes forget.

+7  A: 

You can write a pre-commit hook that checks this. This requires access to the CVS server.

Carl Seleborg
+9  A: 

You will also want a human monitoring the comments that people are adding, though.

Or expect a flurry of "foo", "checkin", "commit", "changed code" comments as people try and bypass your check.

In a past life, we also enforced the mention of a defect/task ID, and checked that ID existed in the task tracking system...

Paul
"bug fixed" is my personal favorite
tloach
"new stuff" is so handly sometimes :P
David Santamaria
"added feature" is one I've used a few times, myself.
Chris Charabaruk
@David: I would be more worried if I saw "old stuff"... ;)
tloach
How about "agfagfagf"?
Nemanja Trifunovic
A: 

We use Subversion and Tortoise and it is possible to do this.

Basically you need to set the tsvn:logminsize parameter on the trunk folder. This will allow you to set a minimum length for a comment (anything > 1 will result in mandatory comments)

DilbertDave
First, that's a Subversion-only solution, and second, it only works if someone is using TortoiseSVN.
Chris Charabaruk
Since he's using CVS, this won't actually do him any good...
Jason Coco
As already stated CVS is sometimes used as a generic term (worth checking) ;-)
DilbertDave
+4  A: 

Rather than enforce comments through your CVS, just tell your developers that you may be doing spot checks on the comments, so please put in useful comments when you check in your code. While I agree that comments in the code itself are more useful, sometimes it is useful to know what the purpose of a code check-in was (e.g. fixed a bug in rounding tax amounts on invoices). However, this can be easily abused, with someone constantly checking the comments, which wastes a huge amount of time. This way it relies on the honor system, and the fact that no-one wants to be singled out for not putting in the one-line comment that you requested.

Elie
I think it's still worth enforcing, as well as doing spot checks. It stops people forgetting to add a comment at all.
Paul
KISS - auditing is easy.
kenny
+1  A: 

The verifymsg file looks like what you want, although I've never tried it myself. If the commit comment doesn't match certain criteria, the commit is aborted.

jrb