Skip to content

Commit

(:redirect cvs.repo:)

This guide explains how to create a CVS repository for committers.

Create commit group

First, you may want to create a new group with commit rights:

$ doas groupadd commit

For each user you want to give commit rights to:

$ doas usermod -G commit $USER

Replace $USER with the committer's user's name.

Setting CVSROOT

Before we begin, decide where you want the CVS files to be located. You will want to set CVSROOT.

You can set it for just the current shell:

$ export CVSROOT=/path/to/CVS

Replace /path/to/CVS with the actual directory. /CVS is recommended:

$ export CVSROOT=/CVS

As a shortcut, you can add this to the bottom of your ~/.profile so you don't have to type it each time:

$ echo 'CVSROOT="/CVS"' >> ~/.profile

Once CVSROOT is set, you can then omit the -d argument when working with cvs.

Create new repo

To create a new CVS repository, type:

$ doas mkdir $CVSROOT
$ doas chown $USER:commit $CVSROOT
$ cvs init

Replace $USER with the maintainer of CVSROOT.

Import New Module

If you have existing code that you'd like to import to a CVS repository, first change

to the folder containing the source code, then type:

$ cvs import reponame vendortag releasetag

Replace reponame, vendortag, and releasetag. CVS will put the source files inside a directory named reponame inside the CVS root directory. vendortag should be replaced with the vendor (the author) of the repository. releasetag is the tag for the specific release.

For example:

$ cd ~/ircnowd/
$ cvs import ircnowd ircnow start

Note: CVS does not automatically transform the imported source code into a working directory. As a result, any changes you make to the original source code directory cannot be committed to the CVS repo.

To fix this, you will need to checkout the source code. Change your directory to somewhere else to place the new working directory, then type:

$ cd /path/to/new/directory/
$ cvs checkout -P reponame

Replace /path/to/new/directory/ with the directory you want the working directory to be in. Then, replace reponame with the repository name.

Change directory to reponame to make changes. Afterwards, use cvs to commit them:

$ cd reponame
... work on code ...
$ cvs commit

For example, suppose you create a new folder for working directories ~/code/ and then checkout the working directory for ircnowd:

$ mkdir ~/code/
$ cd ~/code/
$ cvs checkout -P ircnowd
$ cd ~/code/ircnowd/
... work on code ...
$ cvs commit

Now, ~/code/ircnowd will have the working directory for ircnowd. CVS will track changes so that you can commit changes to the CVS repo.

If checkout works properly, you can safely delete the old source code directory you imported from (since that one is not tracked by CVS).

$ rm -rf ~/ircnowd/

Granting commit access

You will want to change group ownership and provide group write permissions:

$ doas chown -R $USER:commit $CVSROOT
$ doas chmod -R g+w $CVSROOT

A sample directory should look like this:

# ls -lha /CVS
total 28
drwxr-xr-x   7 root  wheel   512B Oct  9 06:19 .
drwxr-xr-x  10 root  wheel   512B Oct  9 06:10 ..
drwxrwxr-x   3 jrmu  commit  1.0K Apr 29 06:48 CVSROOT
drwxrwxr-x   9 jrmu  commit  512B May  8 11:42 acopm
drwxrwxr-x   2 jrmu  commit  1.0K Aug 26 04:17 botnow
drwxrwxr-x   8 jrmu  commit  512B May 27 16:57 brogue-ce
drwxrwxr-x   6 jrmu  commit  512B May  7 06:46 ircnowd

See Also:

Anoncvs Guide

Cvsweb Guide

CVS Intro