bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19319: ? Unexpected behavior in diff(1)


From: Eric Blake
Subject: bug#19319: ? Unexpected behavior in diff(1)
Date: Mon, 08 Dec 2014 15:46:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]