I want the line number which has been added or changed in the particular revision or corresponding to particular comment.how can i do that in cleartool
Asked
Active
Viewed 243 times
1 Answers
0
There is no equivalent to a git log -S
or -G
(pickaxe search) in ClearCase.
The closest is to parse out the result of a cleartool annotate
(as seen in the OP's previous question).
You can annotate a specific revision by using the extended pathname as the pname
argument (for example, foo.c@@\main\bug405
)
Then you can grep the output of that annotate call in order to grep a particular line or comment.
-
is there any way thorough i can get line no for example 15th line added in abc.java file in revision 2 – Akshay jain Aug 04 '15 at 07:47
-
@akshayjain yes, by using the extended pathname, as I mention in the answer, and illustrated in http://stackoverflow.com/a/31424471/6309. – VonC Aug 04 '15 at 07:49
-
`cleartool annotate -out - -fmt "%Vn |" -nheader TestFile.txt@@\main\1` i tried this command and it is showing only the content added not on which line output : `\main\1 |hi this is trial of cc . |asdfasdf . |asdfsadf` not the line no. where this lines are added in the TestFile.txt – Akshay jain Aug 04 '15 at 09:48
-
as you suggested the extended pathname and i am applying the command _cleartool annotate -out - -fmt "%Vn |" -nheader TestFile.txt@@\main\2_ it should show the lines added in version in 2 only but it is showing the code upto that version showing the code added in versions 0,1,2 – Akshay jain Aug 06 '15 at 08:23
-
@akshayjain that is expected: some lines were introduced in v0, others in v1, others in V2. What you see is the most recetn version (up to the version 2) in which the line was modified. – VonC Aug 06 '15 at 09:07
-
is there a way to get lines only added in version 2 not other version – Akshay jain Aug 06 '15 at 09:34
-
@akshayjain a simple grep should be enough to filter on version 2. – VonC Aug 06 '15 at 09:37
-
i am working on the windows machine and tried this command _cleartool annotate -out - -fmt "%Vn |" -nheader TestFile.txt@@\main\2 |findstr /C:"\main\2"_ but this command is giving only one line which contain \main\2 because other lines have only .(dot) in place of version . – Akshay jain Aug 06 '15 at 10:05
-
@akshayjain indeed. That means the parsing need to be scripted, and will be more complex than a grep. – VonC Aug 06 '15 at 10:20
-
is it possible to get the version number on every line instead of .(dot) on each line and version number on 1st line. – Akshay jain Aug 06 '15 at 12:15
-
@akshayjain not that I know of. – VonC Aug 06 '15 at 12:16
-
i did not get the line numbers with the extended path name also..is there any annotate command in which showing that on this line number this line has been added.through extended command also i am getting only the data i have added not the line number on the file. – Akshay jain Aug 06 '15 at 12:19