Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359951

Summary: Concurrent file renaming and modification are not merged correctly
Product: [Technology] EGit Reporter: Missing name <owe>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: adietish, carsten.pfeiffer, gernot, jochenulrich, markus.duft, matthias.sohn, owe, rademacher, remy.suen, robin.rosenberg, roland
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 372606    
Bug Blocks:    

Description Missing name CLA 2011-10-05 05:01:23 EDT
Build Identifier: 20110615-0604

Similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=347663

I rename a file in branch A, modify the same file in
branch B, and then do a merge, the branches are not correctly merged.

With git commandline this works.

Reproducible: Always

Steps to Reproduce:
1. Have a file F in a common branch C
2. make a branch "A" from C, move the file, commit
3. make a branch "B" from C, edit the file, commit
4. merge A into C
5. rebase B onto C
6. merge result is incorrect

In git console this works.
Comment 1 Missing name CLA 2011-10-19 04:11:45 EDT
Is it possible that the reason for that this does not work in eclipse egit/jgit is, that egit/jgit has not implemented recursive merge?

Commandline-git has implemented recursive merge for some years, which can better resolve file renamings.

Chers
Comment 2 Matthias Sohn CLA 2011-10-21 10:22:05 EDT
JGit has no support for recursive merge yet.
Comment 3 Gernot Kvas CLA 2011-12-20 10:53:22 EST
Any plans when the recursive merge is going to be implemented?
Comment 4 Markus Duft CLA 2011-12-20 11:55:11 EST
this bug causes absolute PANIC currently, as we're switching to EGit in a few days, and now we just discovered this problem with merge rebase and cherry-pick!

this means we cannot ever rename a package in eclipse (without command line client), which is the absolute no.1 use case!
Comment 5 Markus Duft CLA 2011-12-21 02:14:52 EST
i gave this another try. on the web i found some about egit/jgit supporting a rename aware merge, whatever that means. so i had the hope that only /directory/ renames will crash the merge, but i now got to the conclusion that it is impossible to correctly merge /any/ rename/modify situation...

... i suggest raising the priority of this bug dramatically (i can't imagine nobody is merging..?!).

in the meantime, is there a way (without command line) to work around the problem?
Comment 6 Missing name CLA 2012-01-05 14:35:01 EST
@Markus Duft
> in the meantime, is there a way (without command line) 
> to work around the problem?

Something like "git gui" or SmartGIT.
Another reason not to merge or rebase with eclipse is, that is has no 3-way-merge (having 4 merge windows). In Eclipse, a diff is crunched in 2 windows, which is not very natural.
Comment 7 Carsten Pfeiffer CLA 2012-01-06 03:45:21 EST
(In reply to comment #6)
> In Eclipse, a diff is crunched in 2 windows, which is not very natural.

In fact there are three windows, you get the current local, the current remote and the common ancester panes. To see the ancestor pane, you have to click the left-most button in the compare-editor toolbar.
Comment 8 Markus Duft CLA 2012-01-09 02:54:11 EST
uhm... resolving conflicts in eclipse is ok, especially if devs are used to how subversion does it... jgit/egit not doing what we expected is the bigger problem :)
Comment 9 Robin Rosenberg CLA 2013-01-07 19:36:05 EST
Recurive merge is tracked as 380314

*** This bug has been marked as a duplicate of bug 380314 ***
Comment 10 Roland Schulz CLA 2013-06-10 18:15:26 EDT

*** This bug has been marked as a duplicate of bug 372606 ***