Been merging code bases at work, from several forks to one. I was hoping to get this done after we install TFS but my boss wants it done before we do our final check in to PVCS 5.3, which is his prerogative. It falls to me, however, to perform the merge, and I am doing the merge blind – that is I don’t know what the code does, and there is no one to ask.

So what tools can I use? Well PVCS has a code compare tool, which I guess can be used, but given that even the most basic check in is fraught with dangers I am loathe to use it. Any source control that requires you to manually hack a file isn’t to be trusted.

So I did what I normally do in situations like this where the tools I have around me aren’t up to the task, or are found lacking. I hit SourceForge.

There I found WinMerge, which is simplicity in itself. A very nice interface, and wonderfully intuitive, unfortunately it get’s confused easily, especially if the two files being compared are disjointed (bits swapped or moved). This was my primary tool in performing the changes. Also there doesn’t appear to be anyway of taking both section changes into a single file.

So the next tool I found was KDiff3 which is a lot more robust, but with an awkward cluttered interface. In WinMerge you select the two file you wish to merge and then use Alt-Up/Down to cycle between differences. Then you use Alt-Left/Right to decide which side to keep. Very easy and very quick.

KDiff3 uses Ctrl-Up/Down and puts the merge changes into a third file. The GUI isn’t as nice or as clean as the WinMerge one it is a more powerful tool. However to select the changes you have to use Ctrl-1/2/3 (KDiff3 supports 3-way merges) which while doable with one hand means twisting, and with a lot of changes in a file makes it a good candidate for inducing RSI.

Now my advice would be for WinMerge to use the KDiff3 engine (from browsing the mailing list that would require a rewrite of most of WinMerge) or have KDiff3 use the keyboard layout of WinMerge and steal some of the visual designs from it. Both a good tools in their own right but what is stopping them from becoming great tools they both have.