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: Eric Blake <eblake <at> redhat.com>
To: Todd Shandelman <todd.shandelman <at> gmail.com>, P <at> draigbrady.com, 19319 <at> debbugs.gnu.org
Subject: bug#19319: ? Unexpected behavior in diff(1)
Date: Mon, 08 Dec 2014 15:46:28 -0700
[Message part 1 (text/plain, inline)]
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

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

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.