Confused with particular comparing example

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
AlexL
Expert Member
Posts: 131
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Confused with particular comparing example

Post by AlexL »

Hello.

I have two files.
The first file:

Code: Select all

// Line 1:
           ab
// Line 2:
           qw
The second file:

Code: Select all

// Line 1:
           ax
// Line 2:
           qx
Ignoring options:
  • - Lines matching regular expressions:

    Code: Select all

    ^//.*
In this example I would expect both comments be ignored. But only the first comment is ignored, while the second one is shown as a different line. I think this is not what should be.

Of course, if I don't use ignoring options, the result is shown properly. But this example is only part of a task from real life, and in that task I had to use ignoring options, so I reduced the case to the example, which is described above.

Thank you.
User avatar
psguru
Site Admin
Posts: 2409
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

The second comment is also ignored but since some lines is ignored, EDP first compares files without the ignored lines, then puts the ignored lines back into the files. When the second comment is merged back into the files, it becomes a part of the changed blocks that span 3 lines. You can still see that the line is ignored if you set the following option: Options | Misc | "Use Ignored color in diff blocks"
psguru
PrestoSoft
AlexL
Expert Member
Posts: 131
Joined: Wed Aug 11, 2004 6:25 am
Location: Israel
Contact:

Post by AlexL »

psguru wrote:The second comment is also ignored but since some lines is ignored, EDP first compares files without the ignored lines, then puts the ignored lines back into the files. When the second comment is merged back into the files, it becomes a part of the changed blocks that span 3 lines. You can still see that the line is ignored if you set the following option: Options | Misc | "Use Ignored color in diff blocks"
Thank you, this works.

May I ask, why this option exists, and why it is not on by default?
User avatar
psguru
Site Admin
Posts: 2409
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

Having ignored lines highlighted in diff blocks tends to annoy more than help (this is based on the comments from our users). You can try using the setting and see what I mean. Generally, once you learn that lines you set to be ignored are indeed ignored, you don't want to use this setting anymore.
psguru
PrestoSoft
Martin
New Member
Posts: 4
Joined: Wed Oct 31, 2007 1:49 am
Location: North of Germany

Post by Martin »

Hello

In the moment I am evaluating Built 3.5.1.5.
I have the same problems and it worked as you discribed to highlight all the ignored comment lines.
But if I use the "View Filter" function to hide the identical segments, I will still see some of the ignored lines which has been deletet in the second file.

Is there a possibility to get a compare result without any ignored comment line and then to create a HTML Diff report? I haven't found anything till now.

I hope you may help me. Thanks

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

Post by psguru »

I'm a little unclear on what you are describing. Are ignored lines included in a difference? Could you perhaps post a screenshot?
psguru
PrestoSoft
Martin
New Member
Posts: 4
Joined: Wed Oct 31, 2007 1:49 am
Location: North of Germany

Post by Martin »

Hello

First at all: I am a newbie regarding forums, so I hope the links below are working. In addition my English is not the best. Sorry for that.
Are ignored lines included in a difference
Yes!

I defined a new category of comments with the expression ;.*?\n and file extension .ASM. With that, all characters beginning with a ; up to the end off the line should be ignored. This is working for most of the comments.
See: http://www.bilder-speicher.de/071101114 ... -page.html.
The line numbers 1234 to 1240 have been marked as ignored correctly. Even the lines 1252 to 1260.

If I switch on the view filter (View identical segments disabled and number of identical context lines = 0). The lines 1234 to 1240 are not displayed any more. That's correct. But the lines 1252 to 1260 are still displayed although they are comments or blank lines. Why?
See: http://www.bilder-speicher.de/071101107 ... -page.html

I want to get a comparison result without the ignored lines and comments and without the identical segments. Only the added, changed and deleted lines should be displayed. Is this possible?

Thank you in advance for your help.

Martin
Martin
New Member
Posts: 4
Joined: Wed Oct 31, 2007 1:49 am
Location: North of Germany

Post by Martin »

Sorry first link will not work. It should be:

http://www.bilder-speicher.de/071101114 ... -page.html
User avatar
psguru
Site Admin
Posts: 2409
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Post by psguru »

Thanks, I see what you both (I hope) mean now. What happens here is that lines 1252 to 1260, while ignored (and thus identical), are enclosed in a diff block (you can see the yellow rectangle that shows where the current diff block is). This is how our diff algorithm works, and one of its goals is to minimize the number of differences.

When you use the view filter, it can only deal with blocks (identical, added, etc.) but not with individual lines. That's why you can still see lines 1252 to 1260 when the view filter is used.
psguru
PrestoSoft
Martin
New Member
Posts: 4
Joined: Wed Oct 31, 2007 1:49 am
Location: North of Germany

Post by Martin »

Thanks for the answer.

I can imagine, that you need to include again the ignored lines into the blocks (identical, added, etc.) to display the complete text. But for my understanding the ignored lines/parts are no more a part of these blocks, because the ignored parts was not considered for the comparison.
It would be excellent, if there is a possibility to switch of the ignored lines or text parts in the Display options or View filter options. Perhaps in a future version. :wink:

All in all ExamDiffPro seems to be a helpful tool but it cannot be used with us with this difficulty :cry: . Sorry

Martin
Post Reply