Avatar of gram77
gram77
Flag for India asked on

In clearcase how can i find who wrote which line of code.

In CVN, we can view which who wrote which line of code in a procedure.

The whole procedure opens up with line numbers along with the name/id of person who wrote it.

How can i do this in Clearcase
Version Control

Avatar of undefined
Last Comment
JIEXA

8/22/2022 - Mon
JIEXA

cleartool annotate

annotate
gram77

ASKER
I am getting the following message:
ct annotate myile@@/main/mydev/2
cleartool: Error: Operation "annotate" unavailable for manager "z_whole_copy"
        (Operation pathname was: "/opt/rational/clearcase/lib/mgrs/z_whole_copy/annotate")

this is what i found thro net.
annotate is fundamentally text/line oriented, thus it makes no sense to run it for elements which aren't of that type. If your element is a text file,
only with the wrong eltype, you probably want to change its type (ct chtype).

how can i check type of the file?
JIEXA

For my case, element type is "text_file".
Use "cleartool file ..." for testing element type.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
gram77

ASKER
yes, all those are test file, what kind of files will annotate work on, and how do i search for such files?
JIEXA

I suppose you can do "cleartool annotate" for text_file and html types.

I don't understand what are you trying to do, because your last question is going in another direction than the original one. But you can use:

cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | egrep -q "text_file|html" && echo "%CLEARCASE_PN%"  '

Or, you can do "cleartool annotate" for a set of files, and just to ignore the errors, and then "find . -name '*.ann' " to find the resulting annotation files.
gram77

ASKER
command didnt't work for me?
cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | egrep -q "text_file|html" && echo "%CLEARCASE_PN%"  '
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
JIEXA

Or, you're on Windows:

cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | findstr "text_file" > NUL: && echo "%CLEARCASE_PN%"  '
cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | findstr "html" > NUL: && echo "%CLEARCASE_PN%"  '
ASKER CERTIFIED SOLUTION
JIEXA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gram77

ASKER
all files are of type text, so does that mean these files can't be annotate.

what do i need to run annotate on them?
SOLUTION
JIEXA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
JIEXA

If you want to run annotate on all of them in a batch, you can also do:
  cleartool find . -type f -element "eltype(text_file)" -exec "cmd /c cleartool annotate %CLEARCASE_PN%"
  cleartool find . -type f -element "eltype(html)" -exec "cmd /c cleartool annotate %CLEARCASE_PN%"

And then take a look on *.ann files.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23