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

Re: [PATCH] Experimental svn diff -w

From: Sander Striker <s.striker_at_striker.nl>
Date: 2006-02-03 18:25:31 CET

Peter N. Lundblad wrote:
> Hi,
>
> Let me first make it clear that this is just for experimentation. This
> patch is very incomplete, untested and probably buggy.

Great disclaimer ;).
 
> 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.

Ah, yes, that's one way to do it, and cheaper than the other way: providing a
different token compare function.

> 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.

Right, makes sense.
 
> 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'

I wonder if we want options to our own code to be passed with -x.
I can see it for eXternal commands.

> Candidate options are:
> -i --ignore-case (not sure about this; it has encoding problems)

What's the benefit of this option? I'm trying to think of a use
case...

> -b --ignore-space-change (for ASCII whitespace)
> -w --ignore-all-space (dito)

Can't we just pick one option name?

> --strip-trailing-cr (maybe)

Hmm, in that case I would say go for --ignore-eol-style.

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

I guess you only need to modify the output functions to implement
this.

> 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?

Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 3 18:56:24 2006

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