Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shallow clone support #229

Open
Tracked by #2842
dougrathbone opened this issue Oct 20, 2012 · 23 comments · May be fixed by #2070
Open
Tracked by #2842

Shallow clone support #229

dougrathbone opened this issue Oct 20, 2012 · 23 comments · May be fixed by #2070

Comments

@dougrathbone
Copy link

Hi there

I was hoping for support for git clone --depth 1 so that we can support init'ing repos without all the history data.

I'd be happy to have a go but am totally new to the project (as in, 5 mins new)

@ben
Copy link
Member

ben commented Oct 20, 2012

Absolutely, have a go! You might want to see how core git does this, it's probably something in the request sent to the remote. Then take a look at src/fetch.c, the changes will probably start there. Good luck, and don't be afraid to ask questions; we hang out in #libgit2 on irc.freenode.net.

@dougrathbone
Copy link
Author

i'm taking a look at this now. Seeing i've never written in c, i'm a bit out of the loop on how to use interop or even what I am meant to be looking for.

what i've done to date:

  • i've started to add a unit test for CanCloneShallow
  • i've added an optional parameter to Repository.cs
  • started digging around the clone support in libgit2 (dont think there is any depth at all.
  • felt a bit lost as I am not a c programmer at_all

some updates on how JGit have been looking at it over the years:

@dunmatt
Copy link

dunmatt commented Nov 13, 2014

nudge nudge

I'm looking at libgit for a project I have on the drawing board, but it would need this feature. I do know C, but I don't know either the libgit codebase or the git codebase. Does anyone here have an intuition as to how much work adding this feature would be?

@nulltoken
Copy link
Member

I do know C, but I don't know either the libgit codebase or the git codebase.

Hey, that's great! We would be very pleased to help you work on this.

Does anyone here have an intuition as to how much work adding this feature would be?

/cc @carlosmn @ethomson Thoughts?

@ethomson
Copy link
Member

I think discussing it over in a libgit2 issue would be great. We've been thinking about working on this as well, it would be great to pair up.

-ed

On Nov 13, 2014, at 2:46 PM, nulltoken notifications@github.com wrote:

I do know C, but I don't know either the libgit codebase or the git codebase.

Hey, that's great! We would be very pleased to help you work on this.

Does anyone here have an intuition as to how much work adding this feature would be?

/cc @carlosmn @ethomson Thoughts?


Reply to this email directly or view it on GitHub.

@AmadeusW
Copy link

I'm also interested in working on shallow copies.
For reference, here's a closed discussion on libgit2 and unfortunately not too many search results for 'shallow clone'

@burdges
Copy link

burdges commented Jun 17, 2015

Appears the recent discussion is here : libgit2/libgit2#3058

@litetex
Copy link

litetex commented May 31, 2020

This issue is now nearly 8 years old.
The corresponding issue at libgit2/libgit2#3058 is 5 years old.

Will this get implemented soon?
Is there any new information?
(libgit2 has a open PR, but there is currently no progress / was forgotten?; however when it is implemented in libgit2, it must still get implemented here to make it finally working, but I have no idea how long that would take)

In my use-case I just want to use git fetch --prune --unshallow but with the API 😄

@tschissler
Copy link

Any progress on this issue?

@PGoodeBDO
Copy link

Is this on the horizon?

@shaybenh7
Copy link

any progress here guys? this ticket is 11 years old

@hoerup
Copy link

hoerup commented May 9, 2023

With this merged libgit2/libgit2#6396, then it should be feasable to add to libgit2sharp

@painhardcore
Copy link

Legendary 🥇

@DUWENINK
Copy link

DUWENINK commented Jul 6, 2023

wait 11 years

@RyanGaudion
Copy link

🤷‍♂️ bump and +1 here.

@bording with libgit2/libgit2#6396 merged - please can we make this a high priority? It will provide significant performance benefits for a range of use-cases

@hoerup
Copy link

hoerup commented Jul 19, 2023

https://github.com/libgit2/libgit2/releases/tag/v1.7.0

libgit2 has made a new release including the shallow clone feature

@Regenhardt
Copy link

@dougrathbone It's been a few years but as you now have 11 experience with this repository, would you reimplement your initial changes with shallow cloning now available in libgit2?

@AlessandroLenzo
Copy link

Is this supported now or not? Not clear from here. Any code sample? Any documentation?
Please let us know, thanks.

@Regenhardt
Copy link

libgit2sharp does not support shallow cloning yet. Anyone is invited to implement it in a pull request although I do not know how much time the maintainers take for this repository lately, it seems there was very little activity the last few months.

@jkiebzak
Copy link

jkiebzak commented Nov 2, 2023

+1

@hoerup
Copy link

hoerup commented Nov 27, 2023

@bording is it correct to assume that this ticket is solved with cd69365 ??

@bording
Copy link
Member

bording commented Nov 27, 2023

@hoerup No, that just adjusts the format of the internal struct so that the interop continues to work. For now, I've just hardcoded it to always be a full fetch, same as it's always been.

There would need to be more work done to enable shallow clones.

@omdathetkan
Copy link

Shallow cloning would be amazing..,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.