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.

Reply via email to