[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Stats for a file.

From: Mark Reibert <svn_at_reibert.com>
Date: Wed, 12 Mar 2008 21:51:49 -0700

On Wed, 2008-03-12 at 11:34 -0400, Paul Koning wrote:
> >>>>> "Gavin" == Gavin Baumanis <Gavin> writes:
>
> Gavin> Hi Everyone, i would a report of some description that will
> Gavin> display how many lines were edited in a particular set of
> Gavin> files between two revisions. I.e. 1000 lines (combined total)
> Gavin> were edit between revision X and HEAD in a, b, c, d, e, files.
>
> Gavin> And of course, if it is all possible what might be the
> Gavin> required syntax to obtain such information!
>
> svn diff -r rev1:rev2 file | egrep '^[-+][^-+]' | wc -l

I believe that will double (or more) your "changed line" count. I think
in concept something like

diff --side-by-side --suppress-common-lines <foo> <bar> | wc -l

would get a more accurate changed line count. The trick is getting this
to work with "svn diff". The best I could come up with in short order
is:

svn diff --diff-cmd mydiff | egrep -v '^Index:|=+$' | wc -l

where mydiff is the following two-line script:

shift 1
diff --side-by-side --suppress-common-lines "$@"

(The "shift 1" gets rid of the "-u" argument, which conflicts with
--side-by-side.)

-- 
----------------------
Mark S. Reibert, Ph.D.
svn_at_reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-13 05:52:10 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.