Solved

Source Code difference Counter

Posted on 2003-11-16
7
234 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
array6 challenfge 6 62
strCount chalenge 3 50
topping3 challenge 14 50
Program to display an alert on Windows Toolbar 2 65
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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

18 Experts available now in Live!

Get 1:1 Help Now