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

	 :	http://panoptic.com/rking/pkg/cvstools.tgz

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

The current output of "make doc":
	* cvsREVERT - Blows away every change in your local repository.  (Use with caution.)
	* cvsadd - Adds all unknown files (?'s) to the repository
	* cvsalldiff - Show the diffs going all the way back in time
	* cvsci - When you need a down-and-dirty ci.  Meaningful commit messages are YAGNI.
	* cvsdiff - Colorize and page 'cvs diff' output
	* cvsignore - Adds all unknown files (?'s) to the .cvsignore
	* cvslastdiff - Show the most recent diff
	* cvslog - Just reverses the cvslog output
	* cvsmeaningfulci - For those not lazy enough to use cvsci, try this.  Thanks to anon. for the idea/code
	* cvsmv - Go through the tedious steps of moving a file in CVS.  Don't forget to fully qualify the second arg (i.e.: "cvsmv a.rb dir/a.rb", because "cvsmv a.rb dir/" won't work as expected)
	* Rkcvs.pm - Just a couple functions I don't want to copy and paste
	* cvsu - Just a typo-workaround.
	* cvsup - Just a typo-workaround.
	* rwgrep - http://c2.com/cgi/wiki?ReadWriteGrep (This doesn't have anything to do with CVS, but it's handy to have around.)

Please give me any other feedback you might have.

Some semisignificant updates:
	* No longer depends on ruby and perl - just perl.  More people have it, and I can't say that the now-perl files are that much uglier.
	* Removed "vim-pager", "cdiff", and "pdiff" - ColorDiff takes care of me now.  I like it.
	* Removed the need for "bin/lib", which was an annoying symlink.

----

''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 
 #!/bin/sh
 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