Bug 581832 - Ancestor commit lost after rebase
Summary: Ancestor commit lost after rebase
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 6.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.6   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 563805 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-19 04:26 EDT by Yang Shen CLA
Modified: 2023-05-01 01:38 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yang Shen CLA 2023-04-19 04:26:37 EDT
Description:
When I rebasing local branch 'main' onto 'origin/main', after rebase done, original ancestor commit of 'main' lost.

Precondition:
Before rebase, local branch 'main' and 'origin/main' do not have the same ancestor commit.
Comment 1 Yang Shen CLA 2023-04-19 04:29:31 EDT
By the logic in "org.eclipse.jgit.api.RebaseCommand#calculatePickList", current branch's ancestor commit is ignored.
Comment 2 Thomas Wolf CLA 2023-04-23 12:14:23 EDT
Not having a common ancestor means the pick list should include the initial commit, which has parentCount == 0.

And cherry-pick should be able to deal with this commit, too.

This was reported before in bug 563805.
Comment 3 Thomas Wolf CLA 2023-04-23 12:15:44 EDT
*** Bug 563805 has been marked as a duplicate of this bug. ***
Comment 4 Eclipse Genie CLA 2023-04-29 07:34:27 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/201607
Comment 5 Eclipse Genie CLA 2023-04-29 07:34:29 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/201608