GNU bug report logs - #19319
? Unexpected behavior in diff(1)

Previous Next

Package: coreutils;

Reported by: Todd Shandelman <todd.shandelman <at> gmail.com>

Date: Mon, 8 Dec 2014 22:29:01 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Todd Shandelman <todd.shandelman <at> gmail.com>
To: Eric Blake <eblake <at> redhat.com>
Cc: 19319 <at> debbugs.gnu.org, Pádraig Brady <P <at> draigbrady.com>
Subject: bug#19319: ? Unexpected behavior in diff(1)
Date: Mon, 8 Dec 2014 17:50:38 -0600
[Message part 1 (text/plain, inline)]
Thanks.
Well, I must say that is all rather counter-intuitive.
I never dreamed that the amount of context I select would actually affect
the diff itself and how it is computed.
But if you say so, I guess that is how it works.
Todd

On 8 December 2014 at 16:46, Eric Blake <eblake <at> redhat.com> wrote:

> On 12/08/2014 03:27 PM, Todd Shandelman wrote:
> > With -U1 and -U2 , the --ignore-matching-lines='Id' argument suppresses
> > display of the difference between the 'Id' lines, as expected.
>
> At that (small) level of context, the hunk containing the 'Id' line is
> separate from the remaining hunks, so the hunk is omitted.
>
> >
> > But with -U3, the diff of the 'Id' lines reappears,  in spite of the
> > --ignore-matching-lines='Id'
> > argument.
> >
> > Why is that?
>
> As soon as you have enough context, the hunk for the 'Id' line is the
> SAME hunk as the rest of the changes.  --ignore-matching-lines omits a
> hunk only if the entire hunk matches the regex; but as soon as you have
> other changes, then the entire hunk is output verbatim.
>
> --ignore-matching-lines does NOT ignore individual lines within a hunk,
> but only a hunk at a time.
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
>
[Message part 2 (text/html, inline)]

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

Previous Next


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