# The Official FVWM Homepage - CVS Procedures

Fvwm2 development uses a CVS server.

Note: the state of code in the CVS repository fluctuates wildly. It will contain bugs, maybe ones that crash the program. It may not even compile for you. Consider it alpha-quality code. You have been warned.

## Overview

To know what is going in with the source tree you should be reading mail on the Fvwm Workers List. See the Mailing List Info page for more information.

To build fvwm2 from the CVS sources, you need to have several GNU tools:

- the CVS client version 1.9 or better,
- GCC,
- GNU make,
- autoconf, version 2.13 or better, and
- automake, version 1.4 or better.

## The Initial Download

To make life easier on yourself, create the file `~/.cvsrc', and insert the following lines. These set useful default options for the three most used CVS commands. Do this now before going any further.

     diff -u -b -B
     checkout -P
     update -d -P

Also, if you are on a slow net link (like a dialup), you'll also want a line saying `cvs -z3' in the file. This turns on a useful compression level for all cvs commands. Setting it higher will only waste your CPU time.

Before you can download development source code for the first time, you must login.

     cvs -d :pserver:anonymous@cvs.fvwm.org:/home/cvs/fvwm login

The password is `guest'. The command outputs nothing if it works, and an error message if it failed. You only need to log in once; all subsequent CVS commands read the password stored in the file `~/.cvspass'.

Next, you checkout the latest source code.

     cvs -d :pserver:anonymous@cvs.fvwm.org:/home/cvs/fvwm checkout fvwm

This creates a "fvwm" directory in your current directory. Get in there and get to work.

     cd fvwm
     autoreconf

You did remember to install autoconf and automake, right?

Once you are inside the working directory, you no longer need the long "-d :pserver:..." argument when issuing cvs commands.

CVS commands work from anywhere inside the source tree, and recurse downwards. So if you happen to issue an update from inside the `docs' subdirectory, it will work fine, but only update the docs. In all of the following command examples, we assume that you have cd'd to the top of the fvwm source tree.

## Code Updates

From time to time, the dedicated FVWM Workers will make changes to the cvs repository. Announcements of this are automatically sent to the fvwm-workers list. You will want to be subscribed to this list!

You can update your copy of the sources to match the master repository with the update command.

     cvs update

## Hacking the Code

So you've found a bug you want to fix? Want to implement a feature from the TODO list? Got a new feature to implement? Hacking the code couldn't be easier. Just edit your copy of the sources. No need to copy files to `.orig' or anything. CVS keeps track of the original files for you!

When you have the code in a working state, generate a patch against the current sources in the CVS repository.

     cvs update
     cvs diff -u > patchfile

Mail the patch to the fvwm-workers list with a description of what you did. But read the FAQ file about ChangeLog entries before doing so.

## Conflicts

If someone else has been working on the same files as you have, you may find that you have made conflicting modifications. You'll discover this when you try to update your sources.

     cvs update
     RCS file: /home/cvs/fvwm/fvwm/fvwm/icons.c,v
     retrieving revision 1.5
     retrieving revision 1.6
     Merging differences between 1.5 and 1.6 into icons.c
     rcsmerge: warning: conflicts during merge
     cvs server: conflicts found in fvwm/icons.c
     C fvwm/icons.c

Don't Panic! Your working file, as it existed before the update, is saved under the filename `.#icons.c.1.5'; hence you can always recover it, should things go horribly wrong. The file named `icons.c' now contains both the old (i.e. your) version and new version of lines that conflicted. You simply edit the file and resolve each conflict by deleting the unwanted version of the lines involved.

     <<<<<<< icons.c
        XpmImage    my_image = {0};  /* testing */
     =======
     >>>>>>> 1.6

Don't forget to delete the lines with all the "<", "=", and ">" symbols.

## Getting Other Versions

Sometimes you may want to get a specific version of the sources. For example, let's say you want the sources as they existed for 2.1.5.

Since you'll want to check out a fresh copy of the sources, you'll need to cd out of the fvwm source tree before issuing the following command.

     cvs -d :pserver:anonymous@cvs.fvwm.org:/home/cvs/fvwm checkout -r version-2_1_5 fvwm

This creates a directory called `fvwm', with the sources as they existed for the version 2.1.5. There may be other tags in the repository, and you can use them as parameters for the `-r' option. Do cvs status -v README for a list.

## Getting Commit Access

Using the procedures described above, and being on the workers list are a pre-requisite to gaining update access. We expect to have heard from you more than once on the fvwm-workers list so that we have some idea who you are.

Doing some testing, submitting some patches, and getting involved in the discussions will help us know about you.

After you have been involved for a while, if we don't suggest it, then ask. The fvwm2 development team is not a closed environment, we welcome new members. There are no required duties, all work is strictly voluntary.

If there is agreement on the list that you should be given update access, you will need to choose a CVS user ID and provide an encrypted password. The latter can be obtained with the following Perl snippet:

     perl -e 'print crypt("yourpass",join("",((a..z,A..Z,0..9)[rand(62),rand(62)]))), "\n"'

Change 'yourpass' to whatever you want your password to be.

Once you have update access, re-do the "login" command above using your CVS user ID in place of 'anonymous', and your password in place of 'guest', and you are on your way.

## Starting a Project

Discuss your ideas on the workers list before you start. Someone may be working on the same thing you have in mind. Or they may have good ideas about how to go about it.

If you just have a small patch you want to make, you may just commit it to the main branch. If the change is large, and lots of other work is going on, you may want to do your changes on a "side branch" which will get merged into the main branch later on. Before creating a branch, you discuss the matter with the other workers. If you are new to CVS, you should read the CVS documentation several times, and ask for help. The documentation is sufficiently large and confusing that it is rather difficult to get right the first few times.

## Adding Directories and Files

First create the new directories and files locally. Then, assuming the new directory is named "newdir" and the new file is "newmod.c":

     cvs add -m  "New directory for ..." newdir
     cd newdir
     cvs add -m "File newmod.c is a module that ..." newmod.c

## Deleting Directories and Files

You don't directly delete directories, you delete all the files in a directory and the directory goes away during an "update -dP". To delete one or more files:

     cvs remove -f filename...
     cvs commit -m 'deleted files because' filename...