Concurrent Versions System CVS
June 2003: CVS has won the USENIX STUG Award 2003!!
Software by Dick Grune, VU University Amsterdam.
What is CVS?
CVS (Concurrent Versions System) is a program that allows multiple users to access, modify and update (pseudo)simultaneously a set of files in a directory or several directories, without getting in each other's way, most of the time. Its principles are described more in detail in Dick Grune, Concurrent Versions System, a method for independent cooperation, IR 113, Vrije Universiteit, Amsterdam, pp. 9, 1986.
How does it work?
The original set of files is kept in one or more directories, called the repositories, in the form of RCS files. A user starting for the first time to work on one or more of these directories issues a CreateVersion command in an empty directory, which produces in that directory a copy of the files in the repository. This copy is private to the given user and the user can edit and modify it as he/she sees fit. No other user will be affected, neither by the creation of the copy nor by its modification.
When satisfied with the modified files, the user issues a Commit command, which commits the new files to the repository. For reasons explained below, this Commit command will (almost) always succeed.
Since other users are simultaneously working on their copies, they will also do Commit commands, so after a while the user's copy will no longer be derived from the newest revision in the repository, the way it was when it was first created by doing CreateVersion. In order to catch up with latest developments, the user issues the UpdateVersion command at regular intervals, whenever he/she finds it convenient to do so. UpdateVersion tries to merge the newest developments into the possibly modified user files, using rcsmerge, which does quite a reasonable job. If rcsmerge fails, the user is notified and has to patch some things by hand; this is rare, though.
A Commit command will always succeed when the user's copy derives from the most recent revision. UpdateVersion gives the user the tools to update his/her copy as if it derived from the most recent revision. Therefore a Commit issued right after a check using UpdateVersion will (almost) always succeed; it will fail only when another user did a successful Commit in the interval.
The time between CreateVersion/UpdateVersion and Commit commands can be anything. Neither five minutes nor five months is unusual. No status about outstanding user copies is kept in the repository. This implements very-long-term transactions.
The present system has many more features and options.
How do I get it?
Books and other information on CVS
There is a paper about CVS, from 1986, which I did not manage to get published.
September 2000: The Linux Tuxies, for Development Tools, Second Place.
June 2003: The USENIX STUG Award 2003.
Some early history
[Thanks to David A. Wheeler for making me dig this up.]
I created CVS to be able to cooperate with my students Erik Baalbergen and Maarten Waage on the ACK (Amsterdam Compiler Kit) C compiler. The three of us had vastly different schedules (one student was a steady 9-5 worker, the other was irregular, and I could work on the project only in the evenings). Their project ran from July 1984 to August 1985. CVS was initially called cmt, for the obvious reason that it allowed us to commit versions independently.
Once the Baalbergen-Waage project was finished, and the ACK C compiler had gone over into other hands, I started to clean up the shell scripts of cmt, because it seemed a useful tool, and I called the system CVS. I remember thinking about the complicated interrelated decisions that had to be made - there were RCS files, user files and entries, each of which could be absent, in conflict, removed, etc. - standing at the bus stop at the university waiting for the bus home, in bad autumn weather (1985). My head started to spin and I decided to draw up a big table, just fill in all the combinations and see what came of it. The table is in the ChangeLog with date 14-Dec-1985.
The initial commit of CVS under itself was on 1985/11/23 23:24:37. I posted the improved scripts to comp.sources.unix (and so implicitly to mod.sources) on June 23, 1986, by sending them to one "Rich" at sources@mirror.UUCP. Two years later Brian Berliner picked it up, turned it into C code, and the rest is history.
As a museum piece, the original shell scripts are available in the Google Group archive, where they can be found by searching for 'Grune cvs group:mod.sources.*'. It is all shell scripts, and it requires the RCS package, which itself can be had from umpteen places. It is in working order. The shell script were translated into C by Brian Berliner. For a short statement about the interrelationships, click here. Brian's work is described in: Brian Berliner, CVS II: Parallelizing Software Development, 1990 Winter USENIX Conference, Washington, D.C., January 26, 1990, pp. email@example.com