CCFD - ClearCase for Dummies

CCFD is a little Unix program which adds "ClearCase intelligence" to any program run under its control. In this context, ClearCase intelligence means the program will automatically checkout elements before writing to them in a lazy (just-in-time) fashion. It can optionally checkin, mkelem, etc. automatically too. You may download the full package or view the man page or a short demo here. Installation notes are contained in the README file.

Currently the only platforms for which binaries exist are Solaris 8 (Sparc) and Redhat Linux 7.2 (i386). It's likely these would work for Solaris 9 and other Linux distributions based on glibc 2.2, respectively, but this has not been tested. It's even possible, though less likely, that they'd work on earlier versions. Ports to other platforms or versions are do-able (Windows excepted); contact me for details. And please note that the current release is alpha quality.

Although CCFD might at first seem like just a convenience package for people who don't like to checkout explicitly, it actually has more potential value in the scripting/infrastructure space. Things I've thought of:

Imports

While of course it's too late to replace any of them, it almost makes clearimport, clearfsimport, synctree, and citree unnecessary by letting you run your program of choice to import files to ClearCase. E.g.
	% ccfd -m -i -- gtar -xzf /tmp/newpackage.tar.gz
	% ccfd -m -i -- cp -r /tmp/newpackage .
	% ccfd -m -i -- cpio ...
All these command lines will import a set of flat files into ClearCase, and when used in a populated VOB area will make only the required changes. They don't have the -r/emove feature the specialized tools do but otherwise this use is limited only by what what you can think of to put after the "--". And in fact it would be quite easy to whip up a post-processing script to hand the -remove part.

Legacy Tools

Imagine an old script left over from CVS/VSS/RCS/whatever days that doesn't work right with ClearCase due to making assumptions that files are flat and writeable. Instead of rewriting it with laborious code like "if file exists AND is a versioned element AND is not checked out THEN check it out AND put it on a list of files to checkin later", just run it under CCFD control.

Interop

You can run Samba under CCFD control by prepending "ccfd -misC" to the line that runs smbd, something like:
ccfd -misC -- smbd -D
then add "projects" like this to smb.conf:
[myproject]
        comment = My Project
        path = /view/myview/vobs/myproject
Now a Windows client without any form of ClearCase installed can browse to that share and modify elements without ever knowing they're managed by ClearCase. Samba will check them out at open() and in at close(). It will even start the view if required. Believe it or not, this actually works (at least in limited testing).

IDE's and File Browsers

Some IDE's may not know about ClearCase and have no idea what to do with a read-only filesystem. CCFD could be used to mollify them. Similarly for Unix GUI file explorers.

Editing Help

Consider the least intrusive use of CCFD. We've probably all had the situation where we open a non-checked-out file in our editor because the original plan was just to view it. But then a problem is noticed, a change is made, and now we have a modified edit buffer that can't be written out. Of course there are various other solutions to this but a CCFD solution is to run with CCFD_PLUSMODE=0. Assume the editor is vi for the moment: with PLUSMODE=0 a :w will still fail, but :w! will now succeed. Of course :w would work too if you didn't override CCFD_PLUSMODE; the arguable advantage of this setting is that you retain veto power over the auto checkout. Most other utilities will see that stat() says the file is unwriteable and will respect that, even though it's not true.