Sunday, December 5, 2010

count lines of code between two versions

You can as VonC suggest use two different views. Alternatively you can use the file@@version syntax to access both versions directly if you know exactly what you are looking for. Two views are probably the best option if you are going to automate something (which implementing something in java suggests to me).

When you say "compare lines of code between two clearcase versions" I assume you are looking for something other than the standard cleartool diff (btw, KDiff3 is an excellent diff utility which have clearcase integration, I highly reccommend it), and assume it is more in the "count number of lines" direction you are looking.

However just counting difference in lines will only give limited information, usually it is also interesting to know if the lines that constitutes the difference are mostly added or removed. To give this kind of information you can use diffstat (see this answer for example output).

At my last job I wrote a java gui for running

diff -u file@@/main/branch1/LABEL1 file@@/main/branch2/LABEL2 | diffstat

given two labels, iterating over several files, but I then depended on bash, diff and diffstat from cygwin, I am not aware of any pure java alternatives here.


View the original article here

No comments:

Post a Comment