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

Re: diff wish

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 14 Jun 2011 17:33:48 +0200

On Tue, Jun 14, 2011 at 05:21:27PM +0200, Neels J Hofmeyr wrote:
> Hi Johan,
>
> it's been a while and I still haven't sent you my diff wish we briefly
> touched on the Subversion hackathon.
>
> Here is a fabricated example of why I don't like diff to match empty lines:

> A couple of lines get replaced by completely different ones. By matching the
> blank line in the middle, it becomes far less readable, IMHO. In my fantasy
> dream world, this diff would print:
>
> [[[
> Index: x
> ===================================================================
> --- x (revision 1)
> +++ x (working copy)
> @@ -4,11 +4,13 @@
>
> void aaa()
> {
> - if (x)
> - do(things);
> -
> - if (y)
> - do(stuff);
> + while (x || y)
> + {
> + check(something);
> + notify(stuff);
> +
> + try(somethingelse);
> + }
>
> bb(b);
> }
> ]]]

Do you know about patience diff?
http://bramcohen.livejournal.com/73318.html
I think we should try teaching this algorithm to svn diff at some point.
It's a lot more generic than just checking for empty lines and should
yield the results you want.
Received on 2011-06-14 17:34:36 CEST

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.