views:

1417

answers:

6
+6  Q: 

three way merge

What are the best tools (windows) for performing three way diffs on a folder structure? When performing a three way merge do you have to weigh the productivity gains from allowing the tool to make decisions for you vs. the risk of the tool making an incorrect merge? Any experience shared from three way diffs would be appreciated.

I'm particularly interested in how three-way diffs on folder structures work, and the different implementations/algorithms employed. I've used KDiff3, so I have some understanding, but think I have a lot to learn about this.

This comparison of three way diff tools discusses how guiffy (a three way folder merge tool) is much more conservative in merging, but at the expense of not making as many merge operations automatically, since it recognizes more different types of conflicts. I think three way merges will make it much easier to merge between branches but still have some doubt about how reliable the automatic merge operations are.

+7  A: 

SourceGear's DiffMerge tool can do this and is free.

EDIT: BeyondCompare also does a great job, but it's not free.

Mitch Wheat
I don't think SourceGear's DiffMerge tool does three-way folder diffs (it does do three-way individual files).
Stuart
+2  A: 

Araxis merge is also very good, but not free.

Lars Truijens
+1  A: 

A lot of similar answers, but it may be worth looking at these questions:
Better Merge Tool for Subversion
Best Diff Tool?

Sam Hasler
+5  A: 

Just for the record:

The web-site diffutils does a fine job listing all those tools, including the one allowing three-way comparison. Wikipedia has also an interesting article on it.

When performing a three way merge do you have to weigh the productivity gains from allowing the tool to make decisions for you vs. the risk of the tool making an incorrect merge?

Now, to go beyond the simple listing of tools, I use semi-automatic three-way comparison merges for years (with ClearCase actually) and have saw very few problems with it. To have an ancestor to compare two versions with allow to detect what has been added, removed or modified since that ancestor version.
If those impacted lines are within separate sets of lines, the automatic merge is straightforward. If not, it a a semi-automatic merge as it will display a window asking the user to resolve the merge himself.

So the "tool" will not make any "wild guesses" while automatically merging your files... However, what may cause the tool to do harm is your merge workflow, especially in case of sideway merges.

A sideway merge is a direct merge between two branches (B and C) normally merged from a third (A):
Instead of merging B->A, then A->C, a sideway merge would merge directly B->C.

Now that can lead to some surprises when you merge A (the common root branch) to C, because the sideway B->C merge may have suppressed some lines, whereas A->C may restore those same lines, since the first merge B->A never took place!

That convoluted example is mainly here to illustrate that any three-way merge tool is not likely to "ruin" your files after an automatic merge. But your "merge workflow" (that is, "the order in which you decide to make your merges") is the real potential danger here.

VonC
+2  A: 

P4Merge from Perforce is available for free. For most of my diff needs, I just use WinMerge which is quite good.

BTW, you didn't even told if you need to target a particular platform...

PhiLho
+1  A: 

Beyond Compare is a great diff and merge tool, and it is also the best FTP tool i have seen.

mike nelson
Beyond Compare does not yet have three-way folder diffs in the stand-alone product: http://www.scootersoftware.com/vbulletin/showthread.php?t=5064
Stuart