Solved

Source Code difference Counter

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordappend challenge 8 181
Non-recursive backtracking, using a stack 1 136
Hide vba in gp 7 95
parse convert xml feed to text (python) 2 83
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 …

832 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