Comment 1 for bug 315399

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 315399] [NEW] diff gives huge areas of unnecessary changes

On Fri, 2009-01-09 at 10:25 +0000, fullermd wrote:
> Public bug reported:
>
> diff seems to grab far too large an area for changes.
>
> Consider this file:
>
> --------------
> x
> A
> y
> x
> B
> y
> x
> C
> y
> x
> D
> y
> --------------

bzr only lines up on unique items in the sequence - it first strips out
all dups: the x and y chars go.
then A, B, C, D are used on the left side.

> Let's lowercase some letter. If we do D, it's fine. D and C both, looks fine:
>
> --------------
> @@ -5,8 +5,8 @@
> B
> y
> x
> - C
> + c
> y
> x
> - D
> + d
> y
>
> --------------

I think there is a fuzz factor used here, I'd need to check th code.

>
> But if we lowercase B as well, it goes all nutty:
>
> --------------
> @@ -2,11 +2,11 @@
> A
> y
> x
> - B
> - y
> - x
> - C
> - y
> - x
> - D
> + b
> + y
> + x
> + c
> + y
> + x
> + d
> y
> --------------

And here it has matched from B on the left to the end of the file on the
right (because only ABCD were anchors).

-Rob

--
GPG key available at: <http://www.robertcollins.net/keys.txt>.