Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336887 - Cannot merge two branches
Summary: Cannot merge two branches
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 0.11   Edit
Hardware: All All
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-10 19:41 EST by Bernard Leach CLA
Modified: 2013-05-03 12:35 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Leach CLA 2011-02-10 19:41:48 EST
I have a local 'topic' branch that I've used to merge in an update to my parent's parent.  Since creating the topic branch my parent has a number of commits which I'd like to merge.


A-B-C-D
 \  \ 
  J-I-E-F-G
       \
        H

Where H is actually a merge of E & D (not sure how to represent that in ascii art!).

Then I try to merge G into H and it it fails;

Merge of revisions 107976c5d8d536ddf82ecde62be1d4af36fecbe4, 0f256f58130e0891221fbbfb6882e273b951b6b1 with base 995087d9492d5a040ead7a0859f1f9c4aa25f92a using strategy resolve resulted in: Failed.

Whats odd is;

git show 107976c5d8d536ddf82ecde62be1d4af36fecbe4
fatal: bad object 107976c5d8d536ddf82ecde62be1d4af36fecbe4

git show 0f256f58130e0891221fbbfb6882e273b951b6b1 resolves to G as expected

git show 995087d9492d5a040ead7a0859f1f9c4aa25f92a resolves to a commit before A.

If I reverse the order of the merge, e.g. merge H into G it works as expected.
Comment 1 Robin Stocker CLA 2013-05-03 12:35:43 EDT
I'm not sure from the description whether this is an instance of a merge requiring a recursive merge strategy. Recursive merge was implemented in bug 380314 for 3.0 and there were other fixes to the merge algorithm.

As this is from 2011, I'm going to mark this as fixed. Please reopen if the problem still exists with a nightly version of EGit/JGit.