We help IT Professionals succeed at work.

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

gram77
gram77 asked
on
2,153 Views
Last Modified: 2013-11-25
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
Comment
Watch Question

Commented:
cleartool annotate

annotate

Author

Commented:
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?

Commented:
For my case, element type is "text_file".
Use "cleartool file ..." for testing element type.

Author

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

Commented:
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.

Author

Commented:
command didnt't work for me?
cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | egrep -q "text_file|html" && echo "%CLEARCASE_PN%"  '

Commented:
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%"  '
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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?
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
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.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.