Solved

Source Code difference Counter

Posted on 2003-11-16
7
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

740 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