July 29, 2004

Digging into CVS

Love it or hate it (or both!), Concurrent Versions System (aka CVS) is a major part of the development process in many organizations.

I've spent a bit of time over the last few hours becoming more familiar with CVS at the protocol level to understand some issues that a windows based Eclipse developer is having after a major CVS update last week. Through a long line of corporate ancestry, our group owns CVS and a pile of tools added on top. It wasn't really my problem, but it was interesting (and a few years ago I'd spent a bit of time wandering around in the client code, learning CVS and making custom client tweaks).

Somehow, the Eclipse folks figured out how to do something I'd always wanted on the command line, spitting out a list of top level modules without needing to care if it was in the modules file or not (something we'd avoided using because we have so many groups and mapping things at the top level will inevitably lead to confusion — not that some folks were deterred, damn the torpedos and that sort of thing).

It turns out that Eclipse does a double dip. First it uses an undocumented update command to get the list of top level module names and then it issues a more commonplace 'cvs co -c' which cats the contents of CVSROOT/modules. The first command is where things are failing on the windows client.

I've failed thus far to re-create this from a command line cvs client, but the request data looks like this:

Global_option -n
Argument -d
Directory .
/cvs/root/dir/
Argument .
Directory .
/cvs/root/dir/
update

The return data is most interesting...

Strip out the binary cruft and you'll wind up with a list of commands to create new directories. The text portion of the reply data looks like this:

E cvs update: New directory `top-level-1' -- ignored
E cvs update: New directory `top-level-2' -- ignored
E cvs update: New directory `top-level-3' -- ignored
... and so on ...
E cvs update: New directory `top-level-n' -- ignored

Aha! The top level module list without a modules file. I'll need to dig into the CVS server code again (it's been a couple years) and see how the heck this is doing what it does. It does suggest some ideas for an easy repository exploration tool.

Now that we've got a lot of working packet captures, we just need to capture some requests from the broken WinBox to figure out the problem.

There is one other thing about CVS that I'd never observed before. The data portion of a successful CVS authentication reply is 'I LOVE YOU'. When I realized what it was and what it meant, I had a whole new perspective and it left me laughing for a few moments.

Posted by Dave at July 29, 2004 01:25 AM
Comments