Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

SLOC script to report Number of lines Added, deleted & modified

by Anonymous Monk
on Mar 13, 2009 at 09:45 UTC ( [id://750357]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, Can you please help me to generate Added, Deleted & Modified Lines of Code report for two versions of file. I tried implement the same using unix diff utility, but it is not giving expected results. Regards, Janshi.VBP
  • Comment on SLOC script to report Number of lines Added, deleted & modified

Replies are listed 'Best First'.
Re: SLOC script to report Number of lines Added, deleted & modified
by dHarry (Abbot) on Mar 13, 2009 at 10:22 UTC
Re: SLOC script to report Number of lines Added, deleted & modified
by MidLifeXis (Monsignor) on Mar 13, 2009 at 14:09 UTC

    Please explain what results you expect, how you were generating the report, and what results you were getting.

    --MidLifeXis

Re: SLOC script to report Number of lines Added, deleted & modified
by goibhniu (Hermit) on Mar 13, 2009 at 15:13 UTC

    Don't reinvent the wheel; there are traps in tryign to do this yourself from scratch. I swear I found SLOC in a cpan module once, but I can't seem to find it now. If I come up with a productive search term I'll re-reply.

    update: Text::Diff

    Here's another free tool that promises alot, though I haven't tried it myself:
    SLOCCount


    #my sig used to say 'I humbly seek wisdom. '. Now it says:
    use strict;
    use warnings;
    I humbly seek wisdom.
Re: SLOC script to report Number of lines Added, deleted & modified
by jasonk (Parson) on Mar 14, 2009 at 20:14 UTC
    NAME diffstat - make histogram from diff-output USAGE diffstat [options] [file-specifications] SYNOPSIS This program reads the output of diff and displays a histogra +m of the insertions, deletions, and modifications per-file. DESCRIPTION Diffstat is a program that is useful for reviewing large, compl +ex patch files. It reads from one or more input files which contain out +put from diff, producing a histogram of the total lines changed for ea +ch file referenced. If the input filename ends with .bz2, .Z or .gz, +diffstat will read the uncompressed data via a pipe.

    www.jasonkohles.com
    We're not surrounded, we're in a target-rich environment!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://750357]
Approved by rovf
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-25 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found