Bug 344779 - Pull results in "Can only cherry-pick commits which have exactly one parent"
Summary: Pull results in "Can only cherry-pick commits which have exactly one parent"
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: 1.0.0   Edit
Assignee: Bernard Leach CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2011-05-04 23:12 EDT by Bernard Leach CLA
Modified: 2011-05-18 12:46 EDT (History)
3 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-05-04 23:12:54 EDT
Build Identifier: 0.12.1

With the following repository;

* origin/master
|\
* |
| *
/
*
|
* master

rebasing master onto origin/master results in;

org.eclipse.jgit.api.errors.JGitInternalException: Can only cherry-pick commits which have exactly one parent
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:274)
at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:82)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:104)
at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:115)
at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.run(PullOperationUI.java:90)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Can only cherry-pick commits which have exactly one parent
at org.eclipse.jgit.api.RebaseCommand.initFilesAndRewind(RebaseCommand.java:546)
at org.eclipse.jgit.api.RebaseCommand.call(RebaseCommand.java:214)
at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:265)
... 7 more


Reproducible: Always

Steps to Reproduce:
1. Have an upstream with a merge
2. Have a branch before that merge (no local changes)
3. Rebase branch to the upstream

This should result in a fast forward, fails with odd cherry-pick error.
Comment 1 Bernard Leach CLA 2011-05-04 23:16:57 EDT
Note, the problem occurred during a pull operation with a branch that had the 'rebase' pull option set.
Comment 2 Bernard Leach CLA 2011-05-05 01:13:19 EDT
Proposed patchset;

http://egit.eclipse.org/r/#change,3336
Comment 3 Chris Aniszczyk CLA 2011-05-05 10:32:56 EDT
Nice.

Where are you actually using JGit Bernard? Or are you just an EGit user?
Comment 4 Bernard Leach CLA 2011-05-05 19:58:21 EDT
Just using egit.

Is there any chance of getting this applied as a 0.12.x fix?  We've been hitting this a bit with since our local workflow is to create branches with the rebase merge strategy so a pull will fail anytime the upstream has a merge.
Comment 5 Chris Aniszczyk CLA 2011-05-05 19:59:57 EDT
We're going to be released EGit 1.0 in early June so it may be a bit of a PITA just to spin another point release.

Can you guys work off of our nightly repository once it ends up in master?

http://download.eclipse.org/egit/updates-nightly
Comment 6 Bernard Leach CLA 2011-05-05 20:04:11 EDT
(In reply to comment #5)
> We're going to be released EGit 1.0 in early June so it may be a bit of a PITA
> just to spin another point release.
> 
> Can you guys work off of our nightly repository once it ends up in master?
> 
> http://download.eclipse.org/egit/updates-nightly

If the next release is coming in June there's no point in jumping through hoops to get the fix in.

At the moment we're using a hard-reset or branch delete/re-create.
Comment 7 Chris Aniszczyk CLA 2011-05-05 20:08:21 EDT
(In reply to comment #6)
> If the next release is coming in June there's no point in jumping through hoops
> to get the fix in.

Thanks for your patience, we really love the contributions!
Comment 8 Chris Aniszczyk CLA 2011-05-18 12:46:23 EDT
Merged into master, thanks Bernard.