CVS
My notes on CVS. CVS appears to be just the ticket for getting remote access to sources and also for messing around with source code management in general. This page is how I got my NTpak going with a CVS repository on a Solaris machine, in case it's useful to someone else. I don't claim to know what I'm doing.
- The main CVS resource is Cyclic Software's home page (http://www.cyclic.com). They have a page with links to the main CVS manual; here is a local copy. Binaries can be downloaded from Cyclic Software's download site. (Get the Windows binaries from there and then update cvs.exe from Gordon Chaffee's page -- see below).
- The place to get the Windows binary of cvs.exe and a command-line ssh, which you need for doing secure remote logins, is Gordon Chaffee's SSH and SCP for Windows 95 and NT page. (Actually, I'm not even sure that the rest of the stuff in the Cyclic distribution is needed....)
- Another resource is Pascal Molli's CVS site. It includes this list of distribution sites.
- The Java-based CVS client is here.
- Christopher Hyland's SSH page contains links to other SSH ports. If you're in our cluster, check my NT development tools installation page.
Some simple exercises to get things going. This worked for me on Solaris. For Windows, it should be basically the same if you install the Cyclic Software CVS binaries.
Add this to
.cshrc
and source it:setenv CVSROOT ~/RepositoryWhen I tried it on Windows, the Windows version of CVS seems to assume that the Windows machine is running as a CVS client to a remote server. To have it run the server locally, set CVSROOT in the System control panel to eg::local:c:\users\johnr\RepositoryCreate the CVS repository
cvs initCreate a new directory tree:cd ~/java mkdir diva mkdir diva/canvas mkdir diva/kernelImport the new directory into CVS:cd diva cvs import -m "Created directory" diva local startGet a working version of the new directory structure:cd .. mv diva diva.orig cvs checkout divaTell CVS to set permissions so that files are read-only until a "cvs edit" is performed on them:cvs watch on divaCreate a new source file in diva/canvas. Here's a sample:// A simple Java file // $Header: /home/johnr/cvs/eecs.berkeley.edu/info/cvs.html,v 1.1.1.1 1998/07/20 21:42:55 johnr Exp $ class Foo { public static void main(String[] argv) { System.out.println("Foo!"); } }Add the file to CVS:cd ~/java/diva/canvas cvs add Foo.java cvs commit Foo.java chmod 444 Foo.javaCheck out the file for editing:cvs edit Foo.javaCheck the file back in:cvs commit Foo.javaRemote access -- Solaris
I did this mainly to figure out how to do remote CVS access in principle before messing around with Windows.
If you didn't run steps 3 and 4, you may be prompted for your RSA pass-phrase each time. To use RSA host-key authentication instead, simply use ssh to connect to the other machine using the machine's full name and then connect back to the first machine.
- Generate your RSA encryption keys:
ssh-keygenEnter a passphrase when prompted. This will generate the files~/.ssh/identity
and~/.ssh/identity.pub
, which are your private and public encryption keys respectively.
- Copy
~/.ssh/identity.pub
on the local machine to~/.ssh/authorized_keys
on the remote machine. If you're just testing this and have a shared file-system, then of course this is the same directory.
- Start an xterm inside an ssh agent:
ssh-agent xterm(This step and the following step are optional -- without them you may have to enter your RSA passphrase each time you do a CVS operation.)
- In the new xterm, add your identity file to the agent:
ssh-add
- Tell CVS to use ssh as its remote shell (the default is rsh, which is bad-bad-naughty! these days.)
setenv CVS_RSH ssh
- Run cvs. For example:
cvs -d :ext:brahe.eecs.berkeley.edu:/users/johnr/Repository checkout divaRemote access -- Windows
Windows access to the CVS repository on a UNIX machine is functioning, although it's not as convenient as it could be:
The following is from memory -- if you try it and it doesn't work, email me.
- It runs only in MS-DOS, not bash.
- I can't get RSA host authentication working, so I have to type in my RSA pass-phrase every time.
In theory, the RSA pass-phrase prompt can be rendered unnecessary by using RSA host-key authentication. To do this, use ssh-keygen to generate keys for use as the PC's host keys, place them into c:\ssh\etc\ssh_host_key and c:\ssh\etc\ssh_host_key.pub, and add the public key to ~/.ssh/known_hosts on the UNIX machine.
- Get cvs.exe from Gordon Chaffee's page and replace the Cyclic version. Get the modified ssh binary from the same page and unpack it somewhere.
- Set the following environment variables to equivalent values:
(CVS_RSH must point to Chaffee's ssh binary.)
HOME c:\users\johnr
CVSROOT :ext:kahn.eecs.berkeley.edu:/users/johnr/Repository
CVS_RSH c:\networking\ssh-console\ssh.exe
- Create the directory c:\ssh\etc. Create a file named ssh_config that contains:
Host * RhostsRSAAuthentication yes
- Copy the files ~/.ssh/identity and ~/.ssh/identity.pub from the UNIX machine to the directory c:\users\johnr\.ssh.
- In MS-DOS, run cvs. For example:
cvs checkout divaYou will be prompted for your RSA passphrase.I couldn't make it work. If you can, tell me how!