bug-diffutils
[Top][All Lists]
Advanced

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

[bug-diffutils] Unexpected behaviour in diff tool?


From: M N
Subject: [bug-diffutils] Unexpected behaviour in diff tool?
Date: Wed, 12 Dec 2012 16:35:39 +0000

Hi

I'm trying to use the diff-tool and i've come across something which looks like an unexpected behaviour to me.

Consider the following example

File1
row1 same
row2 diffX
row3 diffY
row4 same
row5 diffZ

File2
row1 same
row2 diffXX
row3 diffYY
row4 same
row5 diffZZ

And then the following comand to compare the files but exclude lines 3 and 5

$ diff -I 'row3' -I 'row5' file1 file2
2,3c2,3
< row2 diffX
< row3 diffY
---
> row2 diffXX
> row3 diffYY

Analysis of the output report
row1 - OK, no diff
row2 - OK, there was a diff and its been reported
row3 - Not OK, there is a diff here yes, but it should be excluded since the -I flag was set
row4 - OK, no diff
row5 - OK, there was a diff but it's been ignored by the -I flag

My conclusion from this is that once a diff is found, the tool ignores all characters until a new row match is found, thus ignoring the -I flag?

To me this looks like unexpected behaviour. What do you guys think?

Regards
Marek

reply via email to

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