Table of Contents

Clump Programming

Clump Programming is a simple process I designed in order to organize my files more efficiently for programming.

Rational

I've been using CVS for about 10 years. This works well for me, but in some situations there is resistance to CVS either because of it's inconvenience or because of technology limitations. It's also not terribly efficient for an individual developer. As a result, I'm looking for a new process.

Advantages

Disadvantages

Creating Clumps

A clump is simply a directory, which you create to organize files for a particular project. The files inside the clump, however, are symbolic links to the actual files, which are located elsewhere (on an FTP server or network share, for example).

A clump should never contain original files. If you are working on a file on your local machine, and you want it organized in the clump, put it elsewhere and link to the original in the clump. This way, your clump is mostly unimportant (backup) files.

Taking a Snapshot

A snapshot is simply a copy of a particular file at some important point in time. The copy is named the same as the file followed by two underscore characters and a snapshot number. The file is stored in a .cbk (clump backup) directory.

Suppose I have a file called “example.txt”. This file was created by another developer and I'm about to edit it. First, I take a snapshot of the file before I edit it. Then I make my changes and take another snapshot when I'm finished. There are now three files, as listed below.

example.txt
.cbk/example.txt__0001
.cbk/example.txt__0002

The original file, example.txt, is still a symbolic link to a file elsewhere. The snapshots, however, are copies of the file on my local file system. They are important only to me (in my case).

If you had a team of developers committed to this system, you could also create the snapshots in the original path, where everyone would have access to them.

Snapshot Information

When you take a snapshot, you should also create a snap file that includes information about what each snapshot is. The snap file is just a text file with a short description of each snapshot. The snap file is named the same as the file with “__snap” added to the end and it is stored in the .cbk directory.

.cbk/example.txt__snap

The contents of the snap file might look something like the following.

===== 0001 =====

Did this or that or the other.


===== 0002 =====

Added 5 more example cases.

I prefer my snap files to be in a wiki-like syntax, so I can easily drop them into my wiki if I need to.

Snapshot Tool

To make snapshots easy, I wrote a command line tool that creates these snapshots automatically.

snap.php

Installation Instructions

mkdir /opt/snap/
cp snap.php /opt/snap/
ln -s /opt/snap/snap.php /usr/bin/snap
chmod +x /usr/bin/snap

Taking a Snapshot

Now, taking a snapshot of a file is easy. Just run the following command from the same directory as the file.

snap <filename>