I'm a die-hard emacs
user, but so far have always used kdiff3
for 3-way merges with ancestor, e.g. when performing git merge
or rebase
. I really like the way that kdiff3
can not only simultaneously display all four versions of the text being merged:
kdiff3
)kdiff3
)kdiff3
)but also makes the differences between A, B, and C clear via colour highlighting. However, kdiff3
unsurprisingly sucks in comparison to emacs
when it comes to text editing of the merge buffer, since kdiff3
is not a full-blown text editor. It also doesn't integrate out of the box with the excellent magit
package. So I'm trying to switch to using ediff
when resolving conflicts in this particular scenario (I have been successfully using ediff
for other use cases for many years).
However, despite reading the ediff
manual and EmacsWiki page, and asking on #emacs
IRC, I can't find a way to simultaneously display all 4 buffers. By default it shows:
Pressing /
switches the window displaying the merge result buffer (C) so that it displays the ancestor buffer, but you can't see the ancestor and the merge result simultaneously. (Also, the diff in the ancestor buffer is highlighted in a single colour which doesn't clearly show which bits differ from the other two visible buffers (A and B), although according to this thread, it seems that unfortunately ancestor diff refinement hasn't been implemented yet.)
Is there an easy way to configure ediff
to simultaneously display all 4 buffers?
This has being added to the trunk version. Now by default, 3-way merges show four buffers, i.e., "local" (buffer A), "remote" (buffer B), the merge result (buffer C) and the ancestor. You can change this default customizing the new option 'ediff-show-ancestor'.
The key '/' is now bound to a new command 'ediff-toggle-show-ancestor': it toggles whether to show 3 (local, remote and result) or 4 (local, remote, result, ancestor) buffers.
These changes will be visible in Emacs 26.1 release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With