Solved

Source Code difference Counter

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

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Progress
Starting up a Project

724 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