GNU bug report logs - #35214
[Bug][diff][3.3] diff showing difference when there is none

Previous Next

Package: diffutils;

Reported by: 方然 <ufo2243 <at> gmail.com>

Date: Wed, 10 Apr 2019 06:16:02 UTC

Severity: normal

Full log


Message #11 received at 35214 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: 方然 <ufo2243 <at> gmail.com>, 35214 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#35214: [Bug][diff][3.3] diff showing
 difference when there is none
Date: Wed, 10 Apr 2019 06:51:55 -0500
[Message part 1 (text/plain, inline)]
On 4/10/19 6:46 AM, Eric Blake wrote:
> On 4/9/19 11:03 PM, 方然 wrote:
> 
>> [image: image.png]
>> it is a same line! and if I delete some lines above and below this line
>> then diff again it shows no difference as I expect.
>> and not only this line all these lines in the first screenshot are same
>> lines but show difference in diff.
>> also use vimdiff to check. and show no difference in vimdiff.
>> [image: image.png]
> 
> Please don't ever send 9 megabytes of screenshots and sample files to a
> mailing list (actually, I was a bit surprised that your images were
> relatively small compared to the bulk of your log files, although it
> would still have been a better use of bandwidth to just paste the text
> from your window rather than capturing screenshots). You caused a lot of
> unnecessary load on the mail server as it multiplied your message out to
> every list recipient. Ideally, you should have minimized your problem
> down to much smaller files - although the nature of the reported problem
> in diff'ing large files may have indeed required the full log files to
> reproduce (where trimming things would have made the problem disappear);
> but even then, hosting your files externally and merely posting a URL in
> the mail is more considerate when you would otherwise be sending more
> than 100k to the list.

That said, when I use diff 3.6, I cannot reproduce the problem:

17172,17174c17172,17174
< 3 12 17
< 8 12 0
< 12 8 1
---
> 3 11 17
> 8 13 0
> 11 8 1
17186c17186

And the output that you reported, while annoying that it is not minimal,
is not _wrong_ per se (applying the diff still results in the correct
patched file, even if it required one line more effort than strictly
required).

The NEWS file mentions for 4.4:
  diff's default algorithm has been adjusted to output higher-quality
  results at somewhat greater computational cost, as CPUs have gotten
  faster since the algorithm was last tweaked in diffutils-2.6 (1993).

so it could have been those fixes that improved diff in the meantime.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 6 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.