/ Markus Amersdorfer:home / university / about:me /
\ Say NO to Software-Patents! \


As usual, this stuff is based on Debian GNU/Linux.

Oh, and BTW: Here's a great document explaining most everything about CVS--Concurrent Versions System.

For those who want to get to know Subversion: Check out Subversion for CVS Users and Subversion: The new-generation CVS.

How to create a CVS repository on an already running CVS server

In order to set up a new CVS repository for user "max" (presuming that the CVS server's root directory is /data/cvs/), run the following commands:

  cvsserver:/data/cvs/# mkdir repository_name
  cvsserver:/data/cvs/# chown max.cvs repository_name
  cvsclient:~$ grep CVS ~/.bashrc
  export CVS_RSH=ssh
  export CVSROOT=max@cvsserver.yourdomain.net:/data/cvs
  cvsclient:~$ cvs checkout repository_name

This last command creates ~/repository_name/ and ~/repository_name/CVS/.

Use the CVS repository

To fill your repository with your files, you can e.g. move your stuff into ~/repository_name/ and run commands like the following (on the cvsclient):

  cd ~/repository_name/

  cvs add file1.txt
  cvs add file2.txt
  cvs add -kb binary.bin

  cvs add dir1
  cvs add dir1/file3.txt

  cvs add dir2
  cd dir2
  cvs add -kb binary2.bin
  cvs add file4.txt

  cd ..

  cvs commit

I like running a simulation ("-n") first before really updating local files from the CVS repository. The other options used here tell CVS to include/create new directories ("-d") possibly currently not to be found locally and to remove local directories ("-P") that have been removed in the repository:

  cvs -n update -dP

In order to really update your local copy of the CVS repository forget about the "-n" option and run:

  cvs update -dP

If you want to get the current status of your project (e.g. to finally release it), run:

  cvs checkout -P repository_name

As with CVS can restore any previous version of your project, directories which once might have existed and had some content back then (but have been removed in the meantime) are not deleted in the CVS directory itself. Instead, there's an Attic directory in it holding the removed files.
In order to have cvs checkout not create those meanwhile removed directories locally, use "-P" in the command above. (Otherwise those old directories will be created as empty ones.)

Automatic mail-notifications for commitments to a repository

If you want to get mails every time somebody commited something to your repository, do the following (on the cvsserver):

  cp /usr/share/doc/cvs/contrib/commit_prep.gz /data/cvs/CVSROOT/
  cp /usr/share/doc/cvs/contrib/log_accum.gz /data/cvs/CVSROOT/

  cd /data/cvs/CVSROOT/
  gunzip commit_prep.gz
  gunzip log_accum.gz
  mv commit_prep commit_prep.pl
  mv log_accum log_accum.pl
  chmod 755 commit_prep.pl
  chmod 755 log_accum.pl

  cvsserver:/data/cvs/CVSROOT# cat commitinfo
    # [... comments ...]
    # commit_prep.pl:
    #   -d  ...  enable debug messages
    ^repository $CVSROOT/CVSROOT/commit_prep.pl -d -r

  cvsserver:/data/cvs/CVSROOT# cat loginfo
    # [... comments ...]
    ^repository_name $CVSROOT/CVSROOT/log_accum.pl -M repository_name -m your@mail-address.net -R reply-to@mail-address.net -u $USER %s

CVS and Security

Two quite serious security considerations to take into account (taken from http://www.wiggy.net/code/cvs-repouid/):

Also see the according Debian Security Advisory (DSA).

back to index

Valid HTML 4.01! Valid CSS! Created with Vim [Blue Ribbon Campaign icon]
© Markus Amersdorfer (markus<dott>amersdorfer<att>subnet<dott>at)
last modified: 2010-02-23 15:42:25
5990 hits