How to use kdiff3 as a 3-way merge tool with mercurial, git, and Tower.app - Ted Naleid:

A 3-way merge actually has four important sources of information:

LOCAL – your file with the changes you’ve made to it
REMOTE – the file you’re merging in, possibly authored by someone else
BASE – the common ancestor file that LOCAL and REMOTE came from
MERGE_RESULT – the file resulting from the merge where you resolve conflicts 

You often need to see all four of these pieces of information to make intelligent choices. Where you came from (LOCAL), where the other person’s changes came from (REMOTE), where you both started (BASE) and where you are now (MERGE_RESULT).

Personally, I prefer seeing just two files with undos.  You view the changes, chose a winner, have the section of both files match that choice, and *POOF*, the highlighting for that conflict in the file margins disappears as if it were never a conflict.  WinMerge works about perfectly.

But though I'm not sure I get three panes (what's canonical again?), I do get 4-panes.  Do I want what I've got, what you've got, or what we started from (though, as my WinMerge pref shows, I'm assuming we don't want what we started from any more, else what kinda programming flunkies are we, anyhow)?  And once I select a "winner", show me in a fourth (or, to follow WinMerge or JEdit's JDiff, just make the winning change to all three).

KDiff3 does that just well enough that I'm using it to merge in git on OS X now.  SourceTree won't call it successfully yet for some reason, but git mergetool works fine from iterm for now.  Setup is only slightly unintuitive, and though the UI is a little klunky, it works just fine.  What's not to like about OSS?

Labels: