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

Bug 515428

Summary: Can't merge/interact with two branches with unrelated histories
Product: [ECD] Orion Reporter: Remy Suen <remy.suen>
Component: GitAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 14.0   
Target Milestone: 15.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Image describing the problem in question. none

Description Remy Suen CLA 2017-04-19 05:01:16 EDT
Created attachment 267849 [details]
Image describing the problem in question.

1. Run this from the CLI.

$ mkdir unrelated
$ cd unrelated 
$ git init
$ echo "A" > tmp.txt
$ git co --orphan other
$ git add tmp.txt
$ git commit -m "x"
$ git co --orphan master
$ git commit -m "y"

2. 

$ node modules/orionode/server.js -w unrelated

3. Open the Git page.

http://localhost:8081/git/git-repository.html

4. Click the 'Reference:' dropdown to point 'master' at 'other'.
5. You can't merge or rebase or anything and the history spins forever.
Comment 1 Remy Suen CLA 2017-04-19 05:03:22 EDT
Actually, I guess this doesn't technically block bug 510062 as the code is in two different places.
Comment 2 Remy Suen CLA 2017-04-19 05:15:44 EDT
The code dies while trying to compare the two branches because a common ancestor can't be found between them for calculating the number of "incoming" and "outgoing" changes.

https://github.com/eclipse/orion.client/blob/6811b5a95ee231658a8446eab4e81a23dd96cc87/modules/orionode/lib/git/commit.js#L523-L525

The promise handling isn't quite right (or maybe it's intentional I don't know) so the "No merge base found" error message from NodeGit never gets propagated back so there's nothing in the browser or server logs.