Cvs Tools

Brought to you courtesy Panoptic, these are some little scripts that came about by following ThreeStrikesAndYouAutomate.

If you work with CVS on the command line, you might find them useful.

The current output of "make doc": Please give me any other feedback you might have.

Some semisignificant updates:

Why do you say that meaningful commit messages are YAGNI? How else can you easily tell what the purpose for a set of changes was, without diffing and examining the files (which is kind of time consuming)?

I have found that I commit changes about 50 times more often than I need to know what the purpose for an old set of changes was, and that about 80% of the commit comments that were "meaningful" at the time are now unhelpful.

My experience has been different. I use commit messages not to determine what changes have occurred in a commit, but to locate the origin of a specific change I'm looking for (e.g. using cvs log). If I spent more than 30 seconds writing a commit message, I spent too long. Mind you, I haven't done any math on this.

I don't always skip the commit messages. If there's a really good way to describe it, I'll cvs ci -m "...". But blamelog's really do tell a lot, for the times I might overzealously use cvsci.

See also CvsToys

For a long long time I've been depending on a pair of one-liners I call diffprep and diffcommit to help me generate sensible cvs log messages. diffprep simply runs 'cvs diff ' and prepends a comment character to each line. I redirect its output to a file, which I then visit in my editor and read through. As I see each change, I can write the appropriate description into the file (without the comment character), then when done I pipe the annotated diff file into diffcommit, which discards the original diff, spits the annotations into per-file commit messages, and runs the appropriate cvs commands

 :; cat ~/scripts/diffprep 
 cvs diff -u $* | sed 's/^/# /g' 
 echo '# Index: done'
 :; cat ~/scripts/diffcommit 
 perl -ne 'if(/^\# Index: (.+)$/) { if($fn) { $out=~s/\047/\047\\\047\047/g;	$out=~s/^\n+//s;$out=~s/\n+$//s; print "cvs commit -m \047$out\047 $fn\n"}; $out="";$fn=$1}; if(!  /^\#/) { $out.=$_ };' 

I subsumed this into cvsmeaningfulci, above. Thanks for the great tip! (Hopefully we'll all use cvsci one day, but this is an excellent bridge.)

A suggestion for cvsmv: how about automatically create log texts "renamed from ... to ..."? --SlavenRezic (2003-03-21)

Actually, version 1 of cvsmv had exactly that. But the scary thing is that it automatically commits the changes. So, the next best thing is to output a cvs ci -m "..." line, that can then be pasted back into the shell... but for some reason I decided against it. Lately, I've been using SubVersion, which as a real move command. --RyanKing

View edit of May 8, 2005 or FindPage with title or text search