bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: bug in diff


From: Dan Hipschman
Subject: Re: bug in diff
Date: Tue, 29 Apr 2008 17:06:18 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

On Tue, Apr 29, 2008 at 02:33:10PM -0700, James Roy wrote:
> 
> Exclusion of differing lines based on a RE seems to work only if the NEXT 
> line is the same in both files.
> 
> Here's an example of what I mean.
> 
> ===============
> address@hidden:~$ diff -I line zap zap2
> 3,4c3,4
> < line 22
> < y
> ---
> > line 2
> > z
> address@hidden:~$ cat zap
> line 11
> x
> line 22
> y
> address@hidden:~$ cat zap2
> line 1
> x
> line 2
> z

>From the man page:

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

I think the key word is 'all'.  E.g., if you did a normal diff on these
two files you would get:

1c1
< line 11
---
> line 1
3,4c3,4
< line 22
< y
---
> line 2
> z

which has two 'changes'.  In the first change:

< line 11
---
> line 1

all the lines match the RE 'line', so it is ignored.  In the second
change, 'y' and 'z' don't match 'line', so the change isn't ignored.

I'm not the authority on this by any means, but it seems correct to me.

Dan




reply via email to

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