tags:

views:

283

answers:

2

Is there a way to perform a Clearcase checkin where the checkin comments are appended directly into the source file? This is like VSS does.

Please, no debates on whether this is a good or bad thing to do, I have zero influence on these matters here.

I need to have checkin data including the date, user, and comments appended (by clearcase) to the end of the file as in VSS.

Is there a cleartool command option for this?

Thanks

+1  A: 

I believe that you have to write your own ClearCase trigger to perform the desired keyword substitution. By searching the net I found an example.

Martin Liversage
+2  A: 

Martin is right.
There is no "command" to do a "keyword substitution," or "keyword expansion" (which is useful for simple Revision System, but can be source of trouble for Version System)

You can find more for RCS keyword extension here.
Your request does require a type manager avoiding the merge conflicts by interposing itself between the file and the real type manager, removing all RCS keywords.


The article "ClearCase keyword substitutions merge manager" involves:

  • a trigger (keyword_subst.pl)
  • a new type manager (keyed_text_file_delta)
  • a new new element type
  • the chtype over any element you want to have keyword substitution on.
  • a preop trigger on the checkin operation tied to this new element type

... a lot of work, but still doable I guess.

As mentioned in the article "Line of source cannot be bigger then 8192 characters.": if one line pass that length, it has to be treated as binary file and can no longer be a candidate for that type manager.


Note: the proposed solution has been reported as not very efficient.

  • it is published on "Developerworks" and as such unsupported.
  • The triggers' code itself was probably someone's attempt at learning Perl,
  • it is hard to make it work on Unix
  • is applied by default to text file (not xml or html files)
  • it does not support comment (which is what you requested in the first place). You need to amend the script to add %c (comment) to a $Log$ field.

As mentioned (just put here for information):

There are other ways to do what you want without adding the information into the ClearCase versions!

  • If "information as file content" IS NOT required then produce a detailed metadata manifest file.
  • If "information as file content" IS required then add a build step that hijacks these "keyword substitution" files and adds the relevant content - just don't checkin the files afterwards!
VonC
Yes, not as simple as I hoped. Thanks for the quick responses, very helpful.