CVS

Someone asked what CVS was. Here's my response.

From: Richard Kettlewell <richardk+ah-from=oxbridge.tat@chiark.greenend.org.uk>
Newsgroups: oxbridge.tat
Subject: Re: Content-Free Bitterness
Date: 15 Mar 2000 20:05:10 +0000

Janet McKnight <pemb0471@sable.ox.ac.uk> writes:

> !explain CVS

"Concurrent Version System". In its simplest form, a bit of software that allows you to relatively conveniently keep multiple versions of a group of related files. For example I keep the source files to my web site under CVS; if I make a change and then decide I want part of the old version back, I can easily retrieve it.

You'll notice, if you 'view source' on most of my web pages, or for that matter just log into chiark and less them, that there is comment that looks like this:

<!-- $Header: /cvs/web/index.html,v 1.18 2000/03/14 21:53:20 richard Exp $ -->

This line is maintained by CVS, and says where this file lives in the CVS repository, that this is the 18th version of that file since it was first checked in to CVS, when it was last edited (last night) and who edited it (me).

By using appropriate commands, I could retrieve any of the previous 17 versions, or see a summary of the differences between any pair of versions - which isn't wildly useful for web pages, but is very useful indeed for program source code.

There are more adventurous uses: for example it allows you to track multiple branches of development of something - for example at work I have a "stable" branch to the software I work on and a "development" branch. The development branch gets new features, the stable branch only gets bug fixes, and CVS keeps these separate (and indeed allows bits of them to be merged, when that's the appropriate thing to do).

It also makes it possible to sensibly have multiple people working on the same set of files; when you edit a CVS-controlled file you get your own private copy separate from anyone else's, and if two people edit the same file (or rather edit their private copy of the same file) it can spot this and (to an extent) help merge their changes.

For example, the configuration for our office mail system at work is all kept under CVS, so that we can each edit it without having to coordinate too much with each other for every trivial change.

(RCS and SCCS address essentially the same problems, but in different ways and with IMO less general utility. Not that CVS is by any means perfect.)

RJK | Contents