DiffMerge (3.1.0/4.0.6) seems not to Ignore/Strip Whitespace

Support for our DiffMerge utility.

Moderator: SourceGear


Posts: 3
Joined: Tue Feb 12, 2008 2:49 am
PostPosted: Mon Feb 18, 2008 8:20 am
We are using different Editors for development.
Some Editors fill the space with TABs others fill with Whitespaces.

At least in the versions above the ignoring seems to be buggy.
I tried miscellaneous settings in menu Tools/Options/Default Ruleset/Edit.../Line Handling!!!

Before DiffMerge appears everything worked fine for us.

I don't add any attachment, because I think it's easy reproducable:
Just create two files one with a space the other with a TAB in front
of an identical word: Compare them with DiffMerge.
They are different!

Can someone help?

Uwe

Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
PostPosted: Mon Feb 18, 2008 10:46 am
there are several options that you can tweak. it may seem a little
too complicated, but it does allow you do things like only ignoring
whitespace that is not inside a string literal.

give the following a try:

<ol><li>edit the Ruleset:
<ul><li>on the "Line Handling" page, check both:
"Ignore/Strip Whitespace" and "Also Ignore/Strip TABS"

this causes all whitespace to be omitted from the lines when
vertically aligning the files. So even though there are differences
in the lines, it won't throw off the vertical alignment.

<li>on the "Content Handling" page under "Default Context Guidelines"
UNCHECK "Whitespace is Important"
and CHECK "Treat TABs as Whitespace".

this causes differences in whitespace (both quantity and SP vs TAB)
within lines to be marked "unimportant". they will still be drawn,
but de-emphasized (when in "Lines and Characters" detail level).
</ul>
<li>on the "Detail Level" page of the options dialog, set the
"Analysis Detail Level" to "Lines and Characters".

this will cause full intra-line highlighting.

<li>then using the toolbar, select "Hide Unimportant Differences".

this will cause "unimportant" differences to not be highlighted.
which is what you want.

<i>Note: this will also hide changes within "comments" - aka
unimportant contexts as defined in the "Matched Contexts" portion
of the "Edit Ruleset/Content Handling' dialog. You can see how
many changes are being hidden at the bottom of the window</i>
</ol>
hope this helps,
jeff
Attachments
screen_shot_SP_vs_TAB.PNG
screen_shot_SP_vs_TAB.PNG (38.87 KiB) Viewed 6727 times

Posts: 3
Joined: Tue Feb 12, 2008 2:49 am
PostPosted: Tue Feb 19, 2008 4:55 am
I made all settings as you discribed.
And it nearly helped!
Thanks so far.

But unfortunately for some reason I don't know,
each first line in a function body (certainly starting
with '{'), is still marked as being different!

See the attachment.
Attachments
DiffMerge.JPG
DiffMerge.JPG (40.92 KiB) Viewed 6705 times

Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
PostPosted: Tue Feb 19, 2008 8:59 am
I think I know what the problem is.

I think the problem is that the single character '{' is
between 2 intra-line changes (the whitespace before
and after it). when "Intra-line smoothing" is turned
on, we take short equal spans and coalesce them into
the surrounding change. (this cuts down on the "confetti"
look of intra-line highlighting.)

You might try setting the "Intra-line Smoothing Threshold"
to zero (on the "Detail Level" page of the options dialog)
and see if it helps.

jeff

PS. I'll log a bug about making all of this simpler.

Posts: 3
Joined: Tue Feb 12, 2008 2:49 am
PostPosted: Tue Feb 19, 2008 9:40 am
Yes, it helped!!!

Thanks!

Return to Support (DiffMerge)

Who is online

Users browsing this forum: No registered users and 2 guests