CCFD - ClearCase for Dummies

CCFD is a little Unix program which adds "ClearCase intelligence" to any program run under its control. This means the program will automatically checkout elements before writing to them in a lazy (just-in-time) fashion. It can optionally checkin, mkelem, etc. on the fly as well. 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 platforms for which binaries exist are Solaris 8 (and up) for Sparc and i386, Slackware 8.1 (and up) for i386, and FreeBSD 5.2.1 (and up) for i386. Ports to other platforms or versions, including Windows, are do-able; see the README or contact me for details. Please note that the current release is alpha quality.

By the way, CCFD may be used in concert with the cleartool emulator NCATOOL on platforms which do not even have ClearCase installed!

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:

Importing Files

While of course it's too late to replace any of them, CCFD 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 /vobs/tps/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.

Non-ClearCase Access from Windows

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.