Here's an awk script that shows the lines for each file in a diff, with totals at the 
end.
It looks like what you get from a cvs log. Just change "Index" to "diff" for a non-cvs 
diff.

use like:

cvs diff -r tag1 -r tag2 |awk -f diffloc.awk

It's ugly but it works :)

Matt

----------------------- snip ---------------------------
#
# count lines in/out (like "cvs log") for an arbitrary diff
# This script can handle recursive diffs
# NOTE: The diff must be in the default format; context and unidiff is not supported
#

/^>/ {i++}
/^</ {j++}

/^Index/ {
        if (saved) {
                printf ("%s\t+%d -%d lines\n", saved, i, j)
                l_in += i
                l_out += j
                i = j = 0
        }
        saved = $0
}

END {printf ("\t\ttotal: +%d -%d lines\n", l_in, l_out)}
----------------------- snip ---------------------------

Eric Siegerman wrote:
> 
> On Thu, Apr 26, 2001 at 03:48:01PM -0700, Keith Beattie wrote:
> > How can I find the total number of lines changed (for text files only)
> > between two static tags for an entire module or subtree of the repository?
> 
> cvs diff -r tag1 -r tag2 | ... | wc
> 
> The ... is whatever intelligence you want to employ to filter out
> noise to get a more accurate count.
> 
> --
> 
> |  | /\
> |-_|/  >   Eric Siegerman, Toronto, Ont.        [EMAIL PROTECTED]
> |  |  /
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea.
>         - RFC 1925 (quoting an unnamed source)
> 
> _______________________________________________
> Info-cvs mailing list
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/info-cvs

_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to