Subject: Re: [bug-diffutils] bug#55652: please elaborate on diff -u -I RE
From: Paul Eggert <[email-masked]>
To: Harald Dunkel <[email-masked]>
Cc: [email-masked]
Date: Thu, 26 May 2022 18:53:20 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

> 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.

One might add an option to make diff behave differently in this case, 
although it's not clear what the "right" behavior would be. In the 
meantime perhaps you can get by with "diff -U0 -Iwhatever".