Bug 485396 - JGit doesn't support pull on detached HEAD
Summary: JGit doesn't support pull on detached HEAD
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.8   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks: 485124
  Show dependency tree
 
Reported: 2016-01-08 05:08 EST by Mickael Istria CLA
Modified: 2017-05-22 07:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2016-01-08 05:08:09 EST
When trying to set up a Pull operation on a detached HEAD, I get the following stack:
org.eclipse.jgit.api.errors.DetachedHeadException: HEAD is detached
	at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:201)
	at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:174)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
	at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:206)
	at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:156)
	at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.runInWorkspace(PullOperationUI.java:131)

However, with regular Git CLI, this is actually a pretty useful operation that always work: from detached HEAD "git pull origin master"
Comment 1 Mickael Istria CLA 2016-02-23 08:29:05 EST
Now that UI for bug 485124 is usable in EGit, this issue shows up as an error if one is trying to pull on detached HEAD.
I'm putting is as target milestone 4.3 because I believe it should be targeted for the 4.3 release (just like bug 485124). However, I currently don't have the time to work on this; so don't interpret it as a commitment from my side and feel free to take the bug if you'd like it.
Comment 2 Eclipse Genie CLA 2017-03-14 12:54:22 EDT
New Gerrit change created: https://git.eclipse.org/r/93047
Comment 3 Mickael Istria CLA 2017-03-20 09:04:15 EDT
Putting tentative target to 4.7.1 as it may be eligible as a maitenance fix.
Comment 4 Mickael Istria CLA 2017-04-18 05:47:52 EDT
Is there anything I can do to improve the chances of this patch to be merged soon (and hopefully available in Oxygen) ?
Comment 5 Eclipse Genie CLA 2017-05-08 19:05:12 EDT
Gerrit change https://git.eclipse.org/r/93047 was merged to [master].
Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=5b84e25fa3afe66bbfa7eb953ea0bd332c745ecd
Comment 6 Mickael Istria CLA 2017-05-22 06:38:19 EDT
Thanks a lot for the review and merge Matthias! With latest EPP, I could `pull --rebase` from my project in the Eclipse IDE. As I'm almost always using detached branches, it feels like it's the first time a pull works for me. It really makes me happier!
Does JGit has a N&N? I think it would be worth mentioning.
Comment 7 Matthias Sohn CLA 2017-05-22 07:48:34 EDT
you can mention this here (didn't write the release notes yet)
https://wiki.eclipse.org/JGit/New_and_Noteworthy/4.8