Bug 212811 - 3 way diff / merge
3 way diff / merge
Status: NEW
Product: utilities
Classification: Unclassified
Component: Diff
PC All
: P3 with 8 votes (vote)
Assigned To: Ondrej Vrabec
Depends on:
  Show dependency treegraph
Reported: 2012-05-22 07:10 UTC by emi
Modified: 2014-07-17 19:09 UTC (History)
5 users (show)

See Also:


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:

http://www.flickr.com/photos/foryou/6197709847/ (http://www.perforce.com/product/components/perforce_visual_merge_and_diff_tools ).
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 http://www.araxis.com/merge_mac/topic_threeway_file_comparisons.html is quite descriptive imho. Or, http://furius.ca/xxdiff/doc/screenshots/xxdiff-snap-files3.html

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.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo