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

Summary: 3 way diff / merge
Product: utilities Reporter: emi <emi>
Component: DiffAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: arittner, bdrx, Copperis, err, hmichel, sreimers
Priority: P3    
Version: 7.2   
Hardware: PC   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

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.araxis.com/merge_mac/images/large_merge_3way_screenshot.jpg
http://www.sourcegear.com/images/screenshots/diffmerge/mac_file_window_merge.png
http://www.scootersoftware.com/images/TextMerge.png
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.