Solved

Source Code difference Counter

Posted on 2003-11-16
7
246 Views
Last Modified: 2010-04-17
Hi All

Does any body know of any software (for Windows platform) that will take 2 directories and count the number of lines changed within either each file or the total number of changes between both directories?

(Basically I want some way to find the total number of lines changed from a baseline version of a piece of software - stored
in M$ Visual Source Safe and will be tagged)

Scripts or otherwise welcome.

Thanks
DC
0
Comment
Question by:dclaydon
  • 2
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 9761449
VSS will show you the differences.  I assume it can count the number of differences.  I haven't tried that.

mlmcc
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9761465
Hi dclaydon,

right click on file name in VSS -> show differences

if you want another alternative, download diff from www.gnu.org/software

Cheers!
Sunny:o)
0
 
LVL 1

Author Comment

by:dclaydon
ID: 9761654
VSS Only shows the differences; does not count them.

An besides, I would have to sit there and do about 1000 files individually counting the changes.

Diff is a version of unix diff, which I have already (useful for comparing bulk lots of files, and finding
the differences but not counting them).

DC
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 125 total points
ID: 9761678
>(useful for comparing bulk lots of files, and finding the differences but not counting them).
couting can be accomplished with a simple shell script ...

for i in `ls` ---- for each file in current directory
do
        diff $i ../old/$i > $i.diff     -- compare with the older file and get differences
        echo -n $i >> count_file       ---- echo filename to count file
        wc -l $i.diff >> count_file        --- write the number of lines in differences
done

typically, diff will give 3 lines for each difference, so you can use something like
       temp=`wc -l $i.diff`
       temp=`expr temp / 3`        --- I am not to sure of expr syntax, check it
       echo temp >> count_file

Thats all !!!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now