Re: diff - Odd behavior of opton --ignore-matching-lines

jaalto <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
On 2012-02-22 21:53, Eli Zaretskii wrote:
| > From: Jari Aalto <[email protected]>
| > Date: Wed, 22 Feb 2012 14:29:41 -0500
| > 
| > 
| > Test under Bash:
| > 
| >     echo -e "1 2\n1" > a
| >     echo -e "2 3\n4" > b
| >     diff -u -I '2' a b
| > 
| >     =>
| > 
| >     -1 2
| >     -1
| >     +2 3
| >     +4
| > 
| > Isn't --ignore-matching-lines supposed to ignore all lines matching REGEXP
| > "2" above?
| 
| No.  From "diff --help":
| 
|   -I RE  --ignore-matching-lines=RE  Ignore changes whose lines all match RE.
|                                                                 ^^^

Hm. That's not clear still. I wouldn't know: all what?

May I propose that the wording is made more verbose to explain the
behavior in more layman terms.

Manual now:

       -I, --ignore-matching-lines=RE
              ignore changes whose lines all match RE. 

=> Does it mean like this?

       -I, --ignore-matching-lines=RE
              ignore changes whose lines all match RE. This means that
	      all lines in hunk from FILE1 and FILE2 must match this
	      regexp in order for the whole hunk to be ignored.

Jari
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.