Comparison issue if amount of blanks used for indentation changed

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
pref
New Member
Posts: 4
Joined: Thu Jan 10, 2019 3:17 am

Comparison issue if amount of blanks used for indentation changed

Post by pref » Thu Jan 10, 2019 5:59 am

I'm using the newest version of EDP (10.x) and it seems the tool has an issue with finding correlating lines in modes "Lines and words" or "Lines and characters", no matter if fuzzy line matching is used or not. Only if "Use Ignores" is activated the correlation works fine (just to be mentioned, though it's not an intended comparison mode, of course).

As can be seen in the second screenshot, the only change is the number of spaces within the indentation (2 spaces less):

Such behaviour is very annoying - the things are getting more worse on space changes within the big files - and I definitely wouldn't expect anything like this in any commercial comparison product... Which I unfortunately (?!) already bought.

1. Lines only
01_lines.png
01_lines.png (19.11 KiB) Viewed 217 times
2. Lines and words (or lines and characters)
13343_51d1e63193b8d0d6ca1e8ed227cce85a.png
13343_51d1e63193b8d0d6ca1e8ed227cce85a.png (18.94 KiB) Viewed 223 times
3. Lines and words with Use Ignores
13343_16174f5ea6fafc6ec9235ae8ae730e64.png
13343_16174f5ea6fafc6ec9235ae8ae730e64.png (15.26 KiB) Viewed 223 times
Last edited by pref on Sun Feb 24, 2019 12:40 am, edited 7 times in total.

User avatar
psguru
Site Admin
Posts: 1804
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Comparison issue if amount of blanks used for indentation changed

Post by psguru » Fri Jan 11, 2019 8:32 am

Unfortunately, your first two screenshots are not visible. Could you re-post them?
psguru
PrestoSoft

pref
New Member
Posts: 4
Joined: Thu Jan 10, 2019 3:17 am

Re: Comparison issue if amount of blanks used for indentation changed

Post by pref » Fri Feb 22, 2019 6:51 am

here you go (using [img] tag instead [attachment] for inlines)

User avatar
psguru
Site Admin
Posts: 1804
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Comparison issue if amount of blanks used for indentation changed

Post by psguru » Fri Feb 22, 2019 12:39 pm

Fuzzy matching only affects alignment of lines within changed blocks. Example:
Fuzzy.png
Fuzzy.png (70.24 KiB) Viewed 223 times
In you case, without ignoring white space, lines 30 and 26 happen to be identical, so diff blocks are separated by them (see viewtopic.php?f=3&t=2286#p5730 for a brief explanation).
psguru
PrestoSoft

JeremyNicoll
Expert Member
Posts: 68
Joined: Sun May 02, 2010 12:00 pm
Location: Edinburgh

Re: Comparison issue if amount of blanks used for indentation changed

Post by JeremyNicoll » Sat Feb 23, 2019 3:38 am

Where are the screenshots? It's hard to learn without seeing what's being discussed.

User avatar
psguru
Site Admin
Posts: 1804
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Comparison issue if amount of blanks used for indentation changed

Post by psguru » Sat Feb 23, 2019 10:18 am

I can see all of them. Odd that you can't. Anyone else having this problem?

PS: I can't see the first image in the OP's post as well as it turns out. The rest are fine.
psguru
PrestoSoft

MSpagni
Expert Member
Posts: 351
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Re: Comparison issue if amount of blanks used for indentation changed

Post by MSpagni » Sat Feb 23, 2019 1:40 pm

I can't see any.

User avatar
psguru
Site Admin
Posts: 1804
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Comparison issue if amount of blanks used for indentation changed

Post by psguru » Sat Feb 23, 2019 2:38 pm

I restored most of them, one that I can't see seems to be missing on the server.
psguru
PrestoSoft

JeremyNicoll
Expert Member
Posts: 68
Joined: Sun May 02, 2010 12:00 pm
Location: Edinburgh

Re: Comparison issue if amount of blanks used for indentation changed

Post by JeremyNicoll » Sat Feb 23, 2019 3:53 pm

Thank-you! All images (except the first) are now visible.

pref
New Member
Posts: 4
Joined: Thu Jan 10, 2019 3:17 am

Re: Comparison issue if amount of blanks used for indentation changed

Post by pref » Sat Feb 23, 2019 6:57 pm

I've uploaded the first screenshot once again
(hope it won't disappear too quickly - bad bad phpBB)

pref
New Member
Posts: 4
Joined: Thu Jan 10, 2019 3:17 am

Re: Comparison issue if amount of blanks used for indentation changed

Post by pref » Sat Feb 23, 2019 7:22 pm

psguru wrote:
Fri Feb 22, 2019 12:39 pm
In you case, without ignoring white space, lines 30 and 26 happen to be identical, so diff blocks are separated by them (see viewtopic.php?f=3&t=2286#p5730 for a brief explanation).
I got your point, but can't agree with it.

If the ExamDiff Pro's difference engine interprets the line 30 on the left (after the catch block) to match the line 26 on the right (before the catch block) just because of the changed amount of indendation, then the product is IMO not worth its money. Even the free KDiff3 treats such situations correctly. By buying ExamDiff Pro I was hoping to get a better product with a better, more intelligent, comparison engine ;-)

To bring it to the point:

Comparing "without ignoring white space" (e.g. "normal" mode) must not result in difference engine behaving differently compared to the mode "Use ignores". If I unselect the mode "Use ignores" (which are changed amount of spaces at the beginning and at the end of lines in the third example) within the same mode (e.g. "Lines and Words") I'd expect the same results but without spaces being marked, that's it.

Therefore, it's the line 26 on the left (and not the line 30) which must match the line 26 on the right - in all three cases.

MSpagni
Expert Member
Posts: 351
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Re: Comparison issue if amount of blanks used for indentation changed

Post by MSpagni » Sun Feb 24, 2019 1:22 am

pref wrote:
Sat Feb 23, 2019 7:22 pm
Comparing "without ignoring white space" (e.g. "normal" mode) must not result in difference engine behaving differently compared to the mode "Use ignores". If I unselect the mode "Use ignores" (which are changed amount of spaces at the beginning and at the end of lines in the third example) within the same mode (e.g. "Lines and Words") I'd expect the same results but without spaces being marked, that's it.
I see two different needs here: one is to have a different comparing algorithm (ignoring or not ignoring something) and the other is simply a different display mode (showing or not showing some differences).
If I'm not wrong, what is missing is the second option. I must admit I'm intrigued.

JeremyNicoll
Expert Member
Posts: 68
Joined: Sun May 02, 2010 12:00 pm
Location: Edinburgh

Re: Comparison issue if amount of blanks used for indentation changed

Post by JeremyNicoll » Sun Feb 24, 2019 6:04 am

Is it right to say that

- in "Lines" mode, the diff engine identifies exactly-equal lines then displays the blocks of lines between the matching lines,
and because of the mode, only /displays/ whole lines

- in "Lines & words/chars" mode, the diff engine identifies exactly-equal lines then displays the blocks of lines between the matching lines,
and because of the mode, displays more information about the contents of the lines concerned?

That is, mode only affects display, not the decisions of the diff engine?

So maybe the issue is needing separate control of how the diff engine decides lines are 'identical', and/or maybe control of how far ahead it looks when performing that matching. If in this case it didn't look ahead, these sample lines in these files would show as one block added(?) in the lefthand file, and one block (deleted?) in the righthand file... and mode (if set to lines) would show no in-line differences.

User avatar
psguru
Site Admin
Posts: 1804
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Comparison issue if amount of blanks used for indentation changed

Post by psguru » Sun Feb 24, 2019 3:43 pm

Answering to the OP:
Even the free KDiff3 treats such situations correctly.
Matching in EDPro is based on exact equality of lines, after applying all Ignore options (I still don't understand why you can't ignore white space). In KDiff3, on the other hand (http://kdiff3.sourceforge.net/doc/options.html):
When comparing files, KDiff3 first it tries to match lines that are equal in all input files. Only during this step it might ignore white space. The second step compares each line. In this step white space will not be ignored. Also during the merge white space will not be ignored.
This why you see the results you want in KDiff3, in your particular case. As far as I know, our way is more common.

As far as another comment:
I see two different needs here: one is to have a different comparing algorithm (ignoring or not ignoring something) and the other is simply a different display mode (showing or not showing some differences).
It's kind of what KDiff3 does, although pretty arbitrarily IMO.
psguru
PrestoSoft

MSpagni
Expert Member
Posts: 351
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Re: Comparison issue if amount of blanks used for indentation changed

Post by MSpagni » Mon Feb 25, 2019 12:42 pm

Well, I think that adding the possibility of ignoring something during the comparison/matching (like now) but showing it (with proper highlight) in the display can be quite interesting.
What do you think?

Post Reply