Comparison issue if amount of blanks used for indentation changed
Comparison issue if amount of blanks used for indentation changed
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 2. Lines and words (or lines and characters) 3. Lines and words with Use Ignores
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 2. Lines and words (or lines and characters) 3. Lines and words with Use Ignores
Last edited by pref on Sun Feb 24, 2019 12:40 am, edited 7 times in total.
Re: Comparison issue if amount of blanks used for indentation changed
Unfortunately, your first two screenshots are not visible. Could you re-post them?
psguru
PrestoSoft
PrestoSoft
Re: Comparison issue if amount of blanks used for indentation changed
here you go (using [img] tag instead [attachment] for inlines)
Re: Comparison issue if amount of blanks used for indentation changed
Fuzzy matching only affects alignment of lines within changed blocks. Example:
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).
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
PrestoSoft
-
- Expert Member
- Posts: 114
- Joined: Sun May 02, 2010 12:00 pm
- Location: Edinburgh
Re: Comparison issue if amount of blanks used for indentation changed
Where are the screenshots? It's hard to learn without seeing what's being discussed.
Re: Comparison issue if amount of blanks used for indentation changed
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.
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
PrestoSoft
Re: Comparison issue if amount of blanks used for indentation changed
I restored most of them, one that I can't see seems to be missing on the server.
psguru
PrestoSoft
PrestoSoft
-
- Expert Member
- Posts: 114
- Joined: Sun May 02, 2010 12:00 pm
- Location: Edinburgh
Re: Comparison issue if amount of blanks used for indentation changed
Thank-you! All images (except the first) are now visible.
Re: Comparison issue if amount of blanks used for indentation changed
I've uploaded the first screenshot once again
(hope it won't disappear too quickly - bad bad phpBB)
(hope it won't disappear too quickly - bad bad phpBB)
Re: Comparison issue if amount of blanks used for indentation changed
I got your point, but can't agree with it.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).
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.
Re: Comparison issue if amount of blanks used for indentation changed
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).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.
If I'm not wrong, what is missing is the second option. I must admit I'm intrigued.
-
- Expert Member
- Posts: 114
- Joined: Sun May 02, 2010 12:00 pm
- Location: Edinburgh
Re: Comparison issue if amount of blanks used for indentation changed
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.
- 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.
Re: Comparison issue if amount of blanks used for indentation changed
Answering to the OP:
As far as another comment:
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):Even the free KDiff3 treats such situations correctly.
This why you see the results you want in KDiff3, in your particular case. As far as I know, our way is more common.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.
As far as another comment:
It's kind of what KDiff3 does, although pretty arbitrarily IMO.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).
psguru
PrestoSoft
PrestoSoft
Re: Comparison issue if amount of blanks used for indentation changed
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?
What do you think?