For alot of people, CVS is history; they’ve switched to SVN and are loving life. For those of us continuing the use this venerable tool, I present the following cobbled together bit of utility.
It’s a bash function. and a nice way to keep an eye on what’s happening on a cvs repository. I work with a team of around 7 guys, and I like to keep an eye on what’s changed and who changed it.
It works like this, summarizing what I consider to be the highlights from the cvs history
command, and defaults to showing checkins for the current date:
$ cvshist
M 2006-02-22 10:34 EDT jsmith 1.3 InternalOperation.java APRJ7A/src/com/ppc/oepica/model/internal
M 2006-02-22 10:53 EDT jsmith 1.37 FooBarCopier.java APRJ7A/src/com/ppc/oepica/model/external
M 2006-02-22 11:26 EDT darrend 1.23 CommonJobBase.java APRJ7A/src/com/ppc/oepica/model/common
I use the date
command, which gives me some flexibility when specifying a date
$ cvshist yesterday
$ cvshist 2 days ago
$ cvshist january 10
$ cvshist 2006-01-11
Here’s the source. I’ve used this on linux and cygwin; you’ll need bash, gnu date, and cvs.
$ declare -f
cvshist ()
{
export CVSROOT=:pserver:darrend@shlnxtest1:/home/cvs;
TARGET_DATE=$(date -d "$*" +%Y-%m-%d);
cvs history -a -z EDT -c -D $TARGET_DATE | sed "s/\s*==.*$//" | grep "$TARGET_DATE"
}