Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

A tip for viewing recent changes in a Sourceforge CVS repository

I have (and still do) worked on several projects hosted on Sourceforge. For code that I deal with a lot, or for projects where I’m a developer, I often check out the CVS version of a project, to stay up-to-date with the latest changes. And I often find that I’d like to get a concise list of changes that other developers have checked in recently. One should be able to use the cvs log command for this, like so:


cvs log -NS -d >20031201

This would show the revisions that have occurred since December 1, 2003, but would only show the information about files which have actually been modified in that time. The default is to list information about all files in the repository, but the -S flag is supposed to limit to only those files which have been revised, but this does not seem to be supported. So you have to grovel through a ton of file descriptions to find the few that matter.

I finally decided that I’d do something about it. I figured I could write a filter in Perl with about 5 lines of code to do what I wanted. Actually, it only took 4 lines. And that’s only if you count looping strucure as lines of code (if you don’t, it’s only 2 lines of code). The entire program, including the shebang line and a comment, is only 7 lines:


#!/usr/bin/perl
## This is the separator between file descriptions
$/ = "====\n";

while(<>) {
        print if m/----/;
}

I can invoke the filter like so: cvs -q log -N -d >20031201 | cvslogfilt

Maybe this will be useful to somebody else. Next I’ll probably write a wrapper that will let me just tell it how many days back I want to go, so that I can do something like cvslog 4 to see the last 4 days worth of revisions.

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Tech and tagged . Bookmark the permalink.

2 Responses to A tip for viewing recent changes in a Sourceforge CVS repository

Leave a Reply