SourceForge has been redesigned. Learn more.

#425 Three-way merge

GUI (348)

For version control "merges", it would be REALY, REALLY
helpful to have the ability to synchronize an unmodified
file with a modified file, and then apply the changes to a
third file. This type of functionality forms the basis for
parallel code development (ala diff3). Many file
comparison / merge tools support three-way diffs,
although many of them do not actually support the
required functionality of:

apply "B" - "A" to "C"


  • Kimmo Varis

    Kimmo Varis - 2004-08-03
    • priority: 5 --> 3
    • status: open --> open-later
  • Kimmo Varis

    Kimmo Varis - 2004-08-03

    Logged In: YES

    Yes, 3-way merge would be nice.

    Its however a lot of work to add. Most of WinMerge code
    assumes left/right files so all that code must be rewritten
    first. Diffengine code must be updated to newest diffutils
    supporting diff3. And last UI figured out for 3-way merge.

    Setting resolution to later since we need a lot of other
    work happen first.

  • Adam Dymitruk

    Adam Dymitruk - 2007-04-01

    Logged In: YES
    Originator: NO

    This should be a higher priority.

  • Kimmo Varis

    Kimmo Varis - 2007-04-04

    Logged In: YES
    Originator: NO

    I can up the priority when somebody promises to implement this (which is a lot of work, rewriting basics of WinMerge). Not forgetting it probably breaks lots of things in current two-way compare.

    So, currently it is way better to have a good two-way compare than poor 3-way and buggy 2-way compares.

  • xurux

    xurux - 2007-09-11

    Logged In: YES
    Originator: NO

    Note that

    * 3 Way Diff/Merge (like in kdiff3 for example) and
    * apply B-A to C

    is not the same. For example, when B and A are similar, but C is
    quite different, then the 3-way-merge is not so well defined.

    When I had this in one case, I got the better result with the 2nd method,
    which first creates an intermediate representation (can be regular
    "diff" file), and then apply exactly these changes to C.

    When I used 3-way-merge, the result was not so good, my file got messed up a bit
    (maybe it was also my mistake, but generally I don't trust "3-way-merge" so much).

    So, what would be needed is a tool to
    * create B-A as diff file (easy: use regular "diff"), and
    * apply that patch (half manually, in GUI, for conflict resolution where needed)

    See also my feature request: "Graphical Patch Apply Mode" / 1768001.

    Maybe that could be the future direction of development for support of 3-way-merge
    in WinMerge...

  • Cthulhux

    Cthulhux - 2008-07-27

    Logged In: YES
    Originator: NO

    Just wanted to add my voice here... I think three-way merging is the only left reason why anyone should prefer Araxis Merge (the "expensive" edition) to WinMerge yet...

  • Brian Lacy

    Brian Lacy - 2011-06-21

    WinMerge is the most intuitive, clean, functional, and user-friendly compare/merge tool in existence. The single most important MISSING feature, of course, is three-way compare/merge.

    Note: As xurux mentions, all 3-way merge algorithms are not equal! It would certainly be nice if WinMerge offered a choice of merge algorithms, but I think the typical approach employed by most of the commercial tools out there would be just fine.

    The traditional approach to 3-way merging, as I understand it, involves designating one file as the "Ancestor". The "left" and "right" file are then compared to the ancestor file independently. Atomic merges may then be made in any of four directions:
    - Left to Ancestor
    - Right to Ancestor
    - Ancestor to Left
    - Ancestor to Right

    I don't really see this being vastly more technically challenging, as internally, it could be as simple as performing three independent two-way merges. I do all my merges manually (I don't trust even the best of auto-merging algorithms to not screw up my code) anyway, so all I care about it just seeing the actual differences between the three files side-by-side.

  • Fuad Abinader

    Fuad Abinader - 2013-11-13

    It has been almost two years since last comment on this issue, and there are almost 10 years since this feature was first requested. Is there any chance that in the future this feature is incorporated? Because I agree with Brian, this is the most important missing feature!

  • Tim Gerundt

    Tim Gerundt - 2016-03-22

    I wonder if the project maintainers plan to integrate these changes, if not - why?

    Because there are no active project maintainers!

  • Gene Pavlovsky

    Gene Pavlovsky - 2016-03-23

    Too bad, hopefully somebody will step up one day :)


Log in to post a comment.