GNU bug report logs - #55652
please elaborate on diff -u -I RE

Previous Next

Package: diffutils;

Reported by: Harald Dunkel <harri <at> afaics.de>

Date: Thu, 26 May 2022 09:16:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 55652-done <at> debbugs.gnu.org (full text, mbox):

From: Harald Dunkel <harri <at> afaics.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 55652-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#55652: please elaborate on diff -u -I RE
Date: Fri, 27 May 2022 09:53:55 +0200
Hi Paul,

On 2022-05-27 03:53:20, Paul Eggert wrote:
> On 5/26/22 02:15, Harald Dunkel wrote:
>> How comes diff -u
>> reports 2 different lines, with an unchanged line in between?
> 
> What else can diff do? You asked for context, and the context lines differ.
> 

It could show the old ignored lines as unchanged, of course. This would allow
to apply the diff using patch. If it would show the new ignored lines instead,
then you could only reverse apply the diff, which is much less likely to be
useful. In the current implementation it is not useful at all.

> 
>> Is this
>> as expected?
> 
> Yes, the manual says:
> 
>      However, '-I' only ignores the insertion or deletion of lines that
> contain the regular expression if every changed line in the hunk--every
> insertion and every deletion--matches the regular expression.  In other
> words, for each nonignorable change, 'diff' prints the complete set of
> changes in its vicinity, including the ignorable ones.
> 

Where did you find this? The man page for diffutils 3.8 doesn't tell.


Regards

Harri




This bug report was last modified 2 years and 359 days ago.

Previous Next


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