logo
  
Guiffy Software
The Advanced Cross-Platform Diff/Merge
  


Guiffy
Lab Notes

Guiffy Lab Notes will be used to talk about diff and merge tools. We will talk about features, functions, test cases, and who knows what that has to do with diff and merge tools.

Your feedback is always welcome. Tell us what you'd like to hear about. If you have a favorite Diff or Merge Tool test case you'd like us to discuss, please send us your example.

And, as always, we appreciate your input regarding feature or enhancement requests. "I need a way to..." is more valuable than "Attaboy".
Bill Ritcher, CEO & Founder My email
Guiffy Software
February, 2017



---

Hazardous Moves Test Cases September 22, 2017:
The moves.zip test case kit originally built for the SureMerge Whitepaper is updated. The update includes a file set to show the reduced "real world" Visual Studio project XML file minimum changes required to reproduce the "moves" issue. And the update includes another file set of C source files to reproduce the same "moves" issue.

These test cases will be referred to in our discussion of Diff and Merge Tools.

If you have any favorite Diff or Merge test cases, we'd like to see them. Really ugly merge scenarios are always of interest to us. Test cases from the real world are always more meaningful than little snippet tests.

Diff/Merge tool - Ignore Regular Expressions August 22, 2017:
For many text file compare and source file compare scenarios it is an essential requirement to ignore some of the differences. You may need to ignore line sequencing in a source file or dates or timestamps in a log file. Or maybe you want to ignore comments in a source file. These are just a few examples of when you'll need a file compare tool with an option using Regular Expressions to identify a pattern to ignore. In addition to the pattern to ignore you will need to be able specify to ignore just that part of a line, or ignore the entire line. To ignore a block of lines you will need to be able to identify the pattern for the beginning of the block and another pattern for the end of the block.

But Regular Expressions can be difficult to understand for even the most seasoned veterans. Very few of us use Regular Expressions often enough to become an expert. Here's a Tip: Do a search for Regular Expression Tester. You'll find many good tools are available (most of them are online and free). These tools operate interactively and allow you to test your Regular Expression against a test text pattern.

Diff Test tool generates BIG text files July 22, 2017:
As promised a couple months ago, Here's an easy to use tool that generates BIG text files for testing diff tools. The bigtext.zip file has a readme.txt file, the java class file (bigtext.class), and the java source file (bigtext.java). It makes it real easy to generate BIG text files with a one line change in the middle of the file. The readme.txt explains how to run it:

Usage: java bigtext [-options]
bigtest creates 2 big text files for testing. filenames are bigtext1.txt and bigtext2.txt. The default file size is ~ 2MB.
Where options include:
-20mb : create 20MB files
-200mb : create 200MB files
-2gb : create 2GB files
-20gb : create 20GB files

bigtext makes a 1 line change in bigtext2.txt near the middle of the file.

Let us know if you come up with any interesting variations for bigtext or have any test results you'd like to share.

Unified Diff - Not so "Unified" June 24, 2017:
Several years ago we added support for the "Unified Diff" to Guiffy. Our Unified Diff support included specifying the Encoding format. We added the feature in our GUI application, in our non-GUI diff tool, Jiff, and in our API.

Well, so what, we weren't the first (by far) to support the "Unified Diff" format. Then, we heard from folks saying, "Thanks for adding the Encoding format extension. But, I can't find a "Unified Diff" patch tool that will work with any multi-byte encoding format." Sure enough, we couldn't either. So, we could create a "Unified Diff" file in "UTF16" encoding. But, we couldn't find a patch tool that would work with it.

So, you guessed it, we created a "Unified Diff" patch tool that supported Encoding formats, UPatch. And, as usual we added the feature in our GUI application with a "Patch Preview", and in our API.

I have to say it: Unified Diff was not so "Unified".

Playbook for Diff of Huge files May 24, 2017:
Most diff tools cannot compare Huge files. Either they run out of memory or abort with some sort of programmed variable limited to 32 bits. This screenshot shows Guiffy working on Huge files beyond the 32 bits, 2GB limit:

Guiffy 10.6 BIG file compare

Here's a brief list of what it takes to diff huge files:
1) 64 bit run-time I/O: The run-time I/O package needs to be able to access files over 2GB - beyond 32 bits.
2) diff algorithm for huge files: Normal diff algorithms which require both files to be in memory won't work - require too much memory and are way too slow.
3) Context view: The compare view needs the ability to display the results within context - otherwise too much memory is required and its way too slow.
4) Programmed 64 bit variables: The diff application needs to be programmed with 64 bit variables for things like line numbers, etc.

A 64 bit OS and 64 bit application is NOT needed unless the compare view GUI components require so much memory that 32 bits (2GB) isn't enough. In that case, the GUI compare view components need to be a "paged" implementation otherwise the GUI application would be so slow it would be useless anyway. A "paged" implementation requires just a "page" around the current view to be loaded in memory. If the GUI compare view component is programmed with 32 bit variables then that becomes the limit - 2GB in each file's compare view.

In a future post I'll provide the tool for generating huge files such as those in the screenshot above.

Don't Eat My Closer in Merge Tool April 23, 2017:
Another problem most other merge tools have is what I call "eat a closer".

This screenshot is taken from running the "Eat a Closer" test case close.zip.

Guiffy Align Similar Lines

The "eat a closer" problem is that many other merge tools will see the last line in each change (the </LI>) as matching instead of as part of each change. So, if you're not careful as you resolve the conflict, you can loose one of those lines.

Yet another little merge tool detail. But, getting the details right can make all the difference.

Note: This same issue comes up in source code. The "closer" line in source code cases could be a line containing just a } for example.

Align Similar Lines in Diff Tool March 24, 2017:
The Diff tool feature which aligns similar lines can be difficult to describe and easily overlooked but without it as one user put it "I can't see what has actually changed". Based on my recent survey of 5 other diff tools I'd estimate about half of all diff tools (at the most) have this ability. The best way to describe this feature is with a test case and screen shot.

These screen shots are taken from running the "similar" test case similar.zip. Here is the Guiffy diff tool view without the align similar lines option enabled:

Guiffy Align Similar Lines

Here is the Guiffy diff tool view with the align similar lines option enabled:

Guiffy Align Similar Lines

Other diff tools may not have such an option or it may be called something else. Check the diff tool's options/settings and help for such a feature. The "similar" test case helps to determine if the feature is available.

If you have a diff tool feature you'd like to discuss or a test case to share, just let me know.

Keep Both in Merge Tool February 22, 2017
I recently surveyed 5 other 3 way merge tools and was surprised to find none of them have a "Keep Both". They all have just Keep 1st or Keep 2nd. And whats worse they're exclusive of each other - you can't Keep 1st and then also Keep 2nd - at least that would just be 2 clicks instead of one. The only way to "Keep Both" is to Keep 1st or 2nd and then select, copy, and paste the other version's text. Yeah, I know maybe this isn't a big deal - but it sure is irritating. For many if not most merge conflict resolutions you want to at least begin by keeping both changes and then perhaps do some editing.

This screenshot is taken from running the "Eat a Closer" test case close.zip.

Guiffy Align Similar Lines

Try this with other merge tools. Is there some way to "Keep Both" without copy/paste? Let me know what you find. What do you think, am I missing something?




 Copyright 2018 Guiffy Software, Inc. All rights reserved.