Bug 301627 - UploadPack: implement shallow clone
Summary: UploadPack: implement shallow clone
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.1-M3   Edit
Assignee: Matt Fischer CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 332988 (view as bug list)
Depends on:
Blocks: 301628
  Show dependency tree
 
Reported: 2010-02-02 19:01 EST by Shawn Pearce CLA
Modified: 2019-08-12 12:20 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Pearce CLA 2010-02-02 19:01:15 EST
The git native protocol supports shallow clones.  JGit's implementation of that protocol on the server side should support servicing clients that are using the shallow clone feature.
Comment 1 Chris Aniszczyk CLA 2010-12-20 19:29:11 EST
*** Bug 332988 has been marked as a duplicate of this bug. ***
Comment 2 Chris Aniszczyk CLA 2010-12-20 19:29:42 EST
We have some code here:

http://egit.eclipse.org/r/#change,1320
Comment 3 Shawn Pearce CLA 2010-12-20 19:32:18 EST
(In reply to comment #2)
> We have some code here:
> 
> http://egit.eclipse.org/r/#change,1320

That's not enough.  We also have to fix RevWalk to understand the shallow boundary and avoid trying to walk beyond it.
Comment 4 Shawn Pearce CLA 2011-06-13 20:40:37 EDT
I have someone working on this, and may have updated patches soon.
Comment 5 Shawn Pearce CLA 2011-08-14 21:08:02 EDT
Change 1320 on egit.eclipse.org has been updated and filed as CQ 5517.
Comment 6 Chris Aniszczyk CLA 2011-08-15 11:28:39 EDT
We're going to have to get Matt Fischer to reaffirm his contribution on this bug according to the Eclipse IP process.
Comment 7 Chris Aniszczyk CLA 2011-08-15 11:46:59 EDT
Can we have Mat confirm:

1.  You have authored 100% of the content contained within the patch.
2.  You have the rights to contribute the content to the JGit project.
3.  You agree you are contributing the content under the EDL, which is the BSD
license appearing in our file headers.
Comment 8 Matt Fischer CLA 2011-08-15 15:28:09 EDT
I confirm that:

1) I am the sole author of this commit
2) I have the rights to contribute this code to JGit
3) I am submitting this change to the Eclipse project under the terms of the EDL
Comment 9 Shawn Pearce CLA 2011-08-18 17:17:25 EDT
Matt, can you answer this question from the Eclipse IP team?

> Would you happen to know why it appears copyright belongs to
> both employer and employee?
Comment 10 Matt Fischer CLA 2011-08-18 17:26:22 EDT
I'm not exactly sure what they're asking...is it because my comment said that I held the rights to contribute the commit, and then we also had an employer verification that said they owned the rights?  If so, I guess I misunderstood what I needed to say in my individual statement.

This code was written by me (Matt Fischer) on behalf of my employer (Garmin International).  I've given an individual consent as a comment in this thread, and my employer has given a consent in response to an email we received from Sharon Corbett asking for employer consent.  So regardless of whether the copyright is seen as held by me or my employer, I believe that we've given consent to contribute the code to Eclipse.  In any case, that's been the intent--is there something else we need to do?
Comment 11 Chris Aniszczyk CLA 2011-08-21 17:09:55 EDT
Thanks for your patience Matt, look forward to more patches now since you're IP cleared :D
Comment 12 Brad Wood CLA 2015-08-21 22:02:36 EDT
This ticket was closed quite a while back as fixed, but I can't find any references in JGit docs or API on how to use it.  Can anyone confirm if the ability to do a shallow clone was actually added to JGit and if it is documented anywhere?
Comment 13 Shawn Pearce CLA 2015-08-22 13:40:08 EDT
This bug was about the server implementation inside of JGit. The server now supports shallow fetch/clone automatically if the client requests it.

AFAIK the JGit client does not yet support shallow fetch or clone. Adding that support should be under a different bug.
Comment 14 Brad Wood CLA 2015-08-22 23:19:58 EDT
Thanks for explaining Shawn.  I had come across several places on the internet that linked to this bug thinking it affected the client.  I have entered this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=475615
Comment 15 Andrey Butirsky CLA 2019-08-12 11:07:49 EDT
Pushing to a new JGit-hosted repo from shallow clone seems still doesn't work.
Tried to push to Gerrit 3.0.1 repo:

$ git push
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 325 bytes | 325.00 KiB/s, done.
Total 4 (delta 1), reused 2 (delta 0)
remote: Resolving deltas: 100% (1/1)
error: remote unpack failed: error Missing commit b498feadb1c3a0d7904d316ef923516b0f16a95c
To https://gerrit/a/test
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs
Comment 16 Andrey Butirsky CLA 2019-08-12 12:20:21 EDT
(In reply to Andrey Butirsky from comment #15)
> Pushing to a new JGit-hosted repo from shallow clone seems still doesn't
> work.

Maybe related:
[PATCH] Missing commit when fetching on shallow clone
https://bugs.eclipse.org/bugs/show_bug.cgi?id=455343