This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 212811 - 3 way diff / merge
Summary: 3 way diff / merge
Status: NEW
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 7.2
Hardware: PC All
: P3 normal with 10 votes (vote)
Assignee: Ondrej Vrabec
Depends on:
Reported: 2012-05-22 07:10 UTC by emi
Modified: 2016-04-27 10:18 UTC (History)
6 users (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description emi 2012-05-22 07:10:23 UTC
We already have 2-way diff and it's quite nice, but a 3-way diff would be even more useful, when you are doing a rebase, for example, or merging with some colleague that changed the same file.

This is a feature useful in combination with VCS but also with local files (like Tools->Diff).

Some screenshots/tools to understand what I want: ( ).
Comment 1 Petr Somol 2012-05-22 07:30:46 UTC
would be good but depends on resources. reassigning to Tomas for future consideration.
Comment 2 Ondrej Vrabec 2012-05-22 14:51:22 UTC
Could you describe in words how it should work? I don't use external merge tools so i don't know what is the major difference. AFAIK the middle view in all the external tools is the base revision of the conflicted file, but is that the only difference you're missing in our NB tool?
Comment 3 emi 2012-05-22 15:49:59 UTC
Well, first off, 3-way diff is nice when merging with a VCS.

Right now, if I have modified a file locally and it's also been modified in the meantime in the mercurial repository and I do a pull the IDE presents me with:

>There are conflict/locally modified/new file(s) that will be overridden by Pull.\nDo you still want to perform the Pull?

Locally I get a red conflict file which has some "<<<<<<<" and ">>>>>>>". This is a really bad way to visualize what changed.

If I right-click then Mercurial->Resolve conflicts I'm presented with an ugly 2 way diff and a output window.

(Separate note: that window should be a graphical diff window. Why is it different?)

What I *should* see instead of a 2-way diff is a 3-way diff showing me the base file too and allowing me to keep changes from my side or from the other side.

The tool should help me see conflicts in the same way 2-way diff helps me see changes. The photo on is quite descriptive imho. Or,

Then, using those little arrows in the graphical diff I could click to "Insert from left", "Insert from right" or just "Delete" and reach the final text file I want.

Besides merge, a 3-way Tools->Diff would also be handy. Imagine using it to compare visually the same file across multiple repositories that might have diverged.

I think 3-way diff is quite useful and especially with distributed version control systems like git or mercurial it's needed more and more. A lot of programmers will appreciate its arrival in NetBeans.