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

Bug 339254

Summary: [server] Cannot pull a cloned repository
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Szymon.Brandys
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 339354    
Bug Blocks:    

Description John Arthorne CLA 2011-03-08 12:12:10 EST
1) Within Orion, clone a remote repository such as:

http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/

From the command line, attempt to perform a git pull:

C:\1target\foo\.userarea\johna\.gitclone\A>git pull
You are not currently on a branch, so I cannot use any
'branch.<branchname>.merge' in your configuration file.
Please specify which remote branch you want to use on the command
line and try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.


Are we somehow not initializing the local repo correctly on clone? I would expect to be able to push/pull against remote from the command line.
Comment 1 Tomasz Zarna CLA 2011-03-08 12:21:16 EST
Can you tell which version of JGit have been used to create the clone? It looks like a dupe of bug 336621. This may occur with builds made after 20110204 (bug 330898) but before 20110213 (bug 336621).
Comment 2 John Arthorne CLA 2011-03-08 15:19:10 EST
I just pulled the latest org.eclipse.jgit from their master repo, and I get the same problem. Here is the commit id of my current jgit:

f67e5602af72b7b2238eb6f6fcdc206a47edabd5
Comment 3 John Arthorne CLA 2011-03-08 15:26:34 EST
Is there some manual configuration I can do to workaround it? Here is the config for a repository I just cloned via Orion UI:

C:\1target\foo\.userarea\johna\.gitclone\A>git config -l
core.symlinks=false
core.autocrlf=true
color.diff=auto
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
core.autocrlf=true
user.name=John Arthorne
user.email=John_Arthorne@ca.ibm.com
core.repositoryformatversion=0
core.filemode=false
core.logallrefupdates=true
core.autocrlf=false
remote.origin.url=http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.HEAD.remote=origin
branch.HEAD.merge=HEAD
Comment 4 Tomasz Zarna CLA 2011-03-09 09:04:34 EST
(In reply to comment #3)
> Is there some manual configuration I can do to workaround it? 

"git checkout master"
Comment 5 Tomasz Zarna CLA 2011-03-09 10:16:22 EST
No matter if bug 339354 gets fixed or not I will provide a temporary workaround for this problem on our side. We don't want to get into a situation similar to the one with "amend" - bug 339242.
Comment 6 Tomasz Zarna CLA 2011-03-09 10:49:20 EST
I hoped I will be able to do "git checkout master" with JGit API just after a clone is created on the server. Unfortunately, bug 339354 prevents me from doing that as well :/
Comment 7 John Arthorne CLA 2011-03-09 11:55:42 EST
Ok, moving to M7.
Comment 8 Tomasz Zarna CLA 2011-04-11 10:48:44 EDT
Added a test[1] that verifies it's fixed, at least in JGit 0.12.0.201104110422.

[1] http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=2ee758a4db1f83dfe7f6d5eb32bc5f01f4ef0b7e