« OS X Crashes | Main | Sharing Dialup in Maine »

September 4, 2003

Problem with CVS Over SSH

A few weeks back I wrote about getting CVS set up over SSH between a few of our machines. Recently discovered a problem with it.

Each time you perform a checkout from cvs it creates a Root file in the CVS directory of the directory in the checked out module. The Root file contains the CVSROOT where the files were obtained. This is a problem when you set CVSROOT to something like this:

export CVSROOT=:ext:<username>@<machine name>:<cvsroot>
Why is it a problem? Because we have more than one person updating CVS on our boxes and if my username is in that CVS/Root file cvs thinks that it should connect to the server as me, and it prompts users for my password to connect to the CVS server. The environmental variable $CVSROOT is used only if the CVS/Root file doesn't exist.

There are a few ways to deal with this:

  1. The user updating CVS files uses the -d <other CVSROOT> flag which temporarily overrides the CVS/Root

  2. We set individuals CVSROOT to be something like (notice the missing username):
    export CVSROOT=:ext:<machine name>:<cvsroot>
    Which means that on any checkout or update SSH will use the person's login name on the machine, rather than a hard-coded one in the CVS/Root file.

We opted for number 2, and discovered there is no cvs method to reset the CVS/Root, so needed to rid ourselves of the Root files until the next complete checkout, at which time the userless CVSROOT will be used.

The remove command issued just inside the first dir of our CVS tree

find . -name 'Root' -exec rm {} \;

Posted by mike at September 4, 2003 11:13 AM