Comparing Files

Merging Text

Manual Text Merge

Merging—manual or automatic—is at the heart of any file comparison and folder synchronization tool. At the heart of DeltaWalker's manual text merging capabilities are the fly-by merge arrows.

Merge arrows

When DeltaWalker visualizes text files with differences, it draws colored rectangles around the blocks of text that have been deleted, added, that match but have differences, or that, in the case of three-way comparison, match but have conflicting differences.

Reconciling files containing such differences usually involves:

  • Replacing a difference in one file with a difference from another.
  • Inserting a difference from one file at certain place into the other.
  • Deleting a difference.

And this, as illustrated by the screenshot below, is exactly the role of the fly-by merge arrows in DeltaWalker.

Fly-by merge arrow

The merge arrows appear only when the cursor is over a difference, i.e. over a block of text marked as a difference, doing their part to keep DeltaWalker's UI clutter-free. If you move the cursor over the little blue icon and keep it there for a moment, a tooltip will appear, as illustrated above. Pressing Ctrl, or Ctrl+Shift, will draw a small '+' or '-' sign inside the arrow to ensure that the effect of the pending operation is clear.

In three-way comparison, DeltaWalker offers automatic reconciliation of non-conflicting differences.

The combination of manual and automatic merging are two of the tools in DeltaWalker that will help you reconcile—with confidence and ease—even large and heavily modified files.

Automatic Text Merge

In DeltaWalker, the term 'automatic text merge' exists only in the context of a three-way comparison and operates exclusively on non-conflicting changes. While a powerful tool, the concept behind it is simple: walk through all differences between the reference/ancestor and the first modified file, and between the reference and the second modified file, and merge, one-by-one, all differences that do not represent conflicts. A conflicting difference here refers to a block of text present in all three files, that has been modified in both the first and the second modified files. At the end of the automatic merge, if there are conflicting differences, they are left as is; their red-colored background offering a visual clue that attention is needed. As with other DeltaWalker colors, the color used for conflicts is customizable.

The following before and after screenshots illustrate the concept:

Three-way comparison image

The words comprising the various blocks of text are chosen to be brief and informative—each word describes the type of change it represents.

Here are the same three files after automatically merging non-conflicting differences:

Three-way comparison after automatic merging image

A look at before and after screenshots should allow you to see the exact changes the auto-merge engine made to the reference file.

Notice the QuickDiffs in the reference editor—the thin orange lines just above line #3, blue background of line #4, and the green background of lines #1 and #8. These QuickDiffs communicate the exact nature and the content of the changes that just took place.

The conflicting lines were left intact as proper resolution of such conflicts usually depends on the context and is best done by a person who understand the context and consolidate the conflicting changes.

DeltaWalker's undo-redo mechanism tracks all changes made to the editors, including changes made by the auto-merge engine. Its goal is to give you peace of mind as to what the auto-merge result would look like and let you experiment with different approaches, including combining auto-merge with manual conflict resolution, or perform any other combination of operations you find appropriate.

See Also