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

Bug 436543

Summary: Shallow clone doesn't work
Product: Community Reporter: Dennis Huebner <dennis.huebner>
Component: GitAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: thanh.ha
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Dennis Huebner CLA 2014-06-04 04:20:09 EDT
To reduce the space used on our HIPP and speed up the cloning of our repository (~800Mb) I've tried to use the shallow clone. This fails with the following exception: 

MacHuebner:test-shallow dhuebner$ git clone ssh://dhubner@git.eclipse.org/gitroot/tmf/org.eclipse.xtext.git --depth 1
Klone nach 'org.eclipse.xtext'...
Password: 
fatal: Unable to create temporary file '/home/data/git/tmf/org.eclipse.xtext.git/shallow_uQoa4E': Permission denied
fatal: The remote end hung up unexpectedly

Using git protocol also fails but with an other exception:
MacHuebner:test-shallow dhuebner$ git clone http://git.eclipse.org/gitroot/tmf/org.eclipse.xtext.git --depth 1
Klone nach 'org.eclipse.xtext'...
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
Comment 1 Thanh Ha CLA 2014-06-04 09:40:35 EDT
Looks like to shallow clone a repo you need write access to the repo. When we enable Gerrit for your repos we transfer ownership to the gerrit user.


So the way to get around this is to use the Gerrit URLs if you want to shallow clone.

I tried with this command and worked for me:

    git clone ssh://git.eclipse.org:29418/tmf/org.eclipse.xtext.git --depth 1
Comment 2 Thanh Ha CLA 2014-06-04 09:45:15 EDT
(In reply to Dennis Huebner from comment #0)
> To reduce the space used on our HIPP and speed up the cloning of our
> repository (~800Mb) I've tried to use the shallow clone. This fails with the
> following exception: 
> 

I would recommend you shallow clone more than 1 depth. Travis CI uses 50 as it's default depth which I think should work fine for most cases.

There are edge cases which could cause build issues when you have a really low depth. Such as if you are using polling based build triggers and multiple changes are happening rapidly, your build may miss a few commits.
Comment 3 Dennis Huebner CLA 2014-06-05 05:25:49 EDT
https://git.eclipse.org/r/tmf/org.eclipse.xtext works for me, thanks.