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

[PATCH] Experimental svn diff -w

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2006-02-03 14:18:21 CET

Hi,

Let me first make it clear that this is just for experimentation. This
patch is very incomplete, untested and probably buggy.

I'm experimenting with the -w (--ignore-all-space) option for the diff
library, both for 2-way and 3-way diff. This patch is a snapshot of what
I'm doing. I'd like others to take a look at the approach and play with
it for merge and blame.

I've implemented a line normalization function, which currently just drops
all space characters. We can add more options and tune this further. I
also modified the diff3 output routines to output the "modified" (i.e.
"mine") lines for common content rather than the "original" lines. This
obviously does not make any difference when you don't allow different
lines to be treated as equal, but now it is important.

To me, blame seems to work as expected: whitespace-only changes are
"transparent". Also, merge seems to do what I want (afdter the
abovementioned tweak).

The Plan
--------

If people like this, I plan to use the -x option for diff/diff3 options,
as we do for external diffs and allow GNU diff options, e.g.:
svn diff -x '-w'

Candidate options are:
-i --ignore-case (not sure about this; it has encoding problems)
-b --ignore-space-change (for ASCII whitespace)
-w --ignore-all-space (dito)
--strip-trailing-cr (maybe)

I would also like to do -p --show-c-function.

If we want to drag in a regexp library, we could do more general stuff,
but let's start with this basic stuff first.

Comments?

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

  • TEXT/plain attachment: d.txt
Received on Fri Feb 3 14:19:16 2006

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

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