GNU bug report logs - #18076
Lines are not ignored by option -I if they are followed by a line with a difference

Previous Next

Package: diffutils;

Reported by: Jean-Francois Thuong <jean-francois.thuong <at> esterel-technologies.com>

Date: Tue, 22 Jul 2014 08:02:02 UTC

Severity: normal

Tags: notabug

Found in version 3.3

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jean-Francois Thuong <jean-francois.thuong <at> esterel-technologies.com>
To: 18076 <at> debbugs.gnu.org
Subject: bug#18076: Lines are not ignored by option -I if they are followed by a line with a difference
Date: Tue, 22 Jul 2014 14:59:43 +0800
[Message part 1 (text/plain, inline)]
Package: diffutils
Version: 3.3

When 2 (or more) consecutive lines are different between the two compared
files, they are ignored by option -I if all of them are ignored; if the
last line is not ignored, all the lines are returned by diff tool (instead
of only the last line).

Although the documentation clearly indicates this as nominal, it looks
strange while looking at the results to have lines that we supposed to have
been ignored.


------------------
To reproduce:
1. Create 2 files (e.g. File1.txt and File2.txt) having 2 consecutive
different lines (e.g. lines 2 and 3)
2. Run diff with option -I including a pattern matching line 2
3. Observe that diff returns differences for both lines 2 and 3


Note: the files attached could be used as an example with the command line
diff -I "^IGNORE:.*quot; File1.txt File2.txt
The difference is as follows:
2,3c2,3
< IGNORE: Line to be ignored with value = 1
< Different line (version A)
---
> IGNORE: Line to be ignored with value = 2
> Different line (version B)


Jean-Francois Thuong
------------------------------

[signature removed by request]

[Message part 2 (text/html, inline)]
[File1.txt (text/plain, attachment)]
[File2.txt (text/plain, attachment)]

This bug report was last modified 10 years and 303 days ago.

Previous Next


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