Thursday, December 15, 2005

Keyword substitution

As a long-time CVS user, one of the things that has always puzzled me about ClearCase is that it hasn't natively supported keyword substitution. This is a feature whereby you can place a tag in your source code and have the version control system expand it for you. So I could put comment lines like

/* $Author:$ */
/* This is $Revision:$ */

and, if you use the right options with CVS, they will automatically get updated at every checkin with the latest information.

/* $Author: andyp$ */
/* This is $Revision: 1.4$ */


At the last company I worked for before IBM, we used to put a static const char into our C source files containing one or more of these tags, so you'd be able to see the exact versions of the source that a binary was compiled from using the strings command on UNIX. Of course, the new versioning feature in WebSphere Message Broker version 6 also works brilliantly with this kind of function, as you can add keyword substitution tags into the version properties on your flows and message sets, and see the results at runtime.

Time for rejoicing, because Daniel Diebolt has just had a developerWorks article published which describes how to do this using a ClearCase merge manager script.

Incidentally, for those that don't know, I'm one of the authors of SupportPac IC04, WBIMB V5 Change Management and Naming Standards. We are updating this for version 6, but unfortunately the guy who helped to write the ClearCase section has left IBM. This may mean that I get to know ClearCase a whole lot better in the near future, which can only be a very good thing.

Technorati tags:

No comments: