You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@benbalter Currently, the underlying libgit2 code doesn't support making shallow clones nor does it support recursive submodule updates. Using the submodule APIs, it would probably be possible to implement the equivalent of --recursive but I don't think the necessary APIs are currently available in Rugged. I'm pretty sure there is no way to do a shallow clone at all without changes to the libgit2.
Shallow fetches/clones are a mess and still a hack. There is currently an attempt at making them better-defined, but the odd repos that result are a mess and still have many limitations even with git-core.
While not as fast to type, you do have a programming language available, which makes automatic recursive submodule initialisation less of an advantage. It's probably enough of a promiment git-core feature that it will have to be implemented at some point.
Thanks for clarifying @carlosmn - you're right (as always). I do have it on my TODO list to add recursive submodule support to libgit2 checkout and clone, but it hasn't been too high up there. Still, probably a good thing to get to and not too hard, I think.
Activity
arrbee commentedon Dec 2, 2013
@benbalter Currently, the underlying libgit2 code doesn't support making shallow clones nor does it support recursive submodule updates. Using the submodule APIs, it would probably be possible to implement the equivalent of
--recursive
but I don't think the necessary APIs are currently available in Rugged. I'm pretty sure there is no way to do a shallow clone at all without changes to the libgit2.benbalter commentedon Dec 3, 2013
Le sad. Thanks for the prompt response.
carlosmn commentedon Dec 3, 2013
Shallow fetches/clones are a mess and still a hack. There is currently an attempt at making them better-defined, but the odd repos that result are a mess and still have many limitations even with git-core.
While not as fast to type, you do have a programming language available, which makes automatic recursive submodule initialisation less of an advantage. It's probably enough of a promiment git-core feature that it will have to be implemented at some point.
arrbee commentedon Dec 3, 2013
Thanks for clarifying @carlosmn - you're right (as always). I do have it on my TODO list to add recursive submodule support to libgit2 checkout and clone, but it hasn't been too high up there. Still, probably a good thing to get to and not too hard, I think.
ben commentedon Dec 3, 2013
Better shallow-repo support is on my list, but the concepts are tangled up with alternates and grafts, and it could get a little hairy.
dideler commentedon Feb 17, 2016
FWIW, related libgit2 issue is libgit2/libgit2#3058
kjetilho commentedon Dec 27, 2023
libgit2 added shallow support in version 1.7.0 (July 2023)
benbalter commentedon Dec 28, 2023
Thanks for updating this ancient issue. Marking as resolved.
kjetilho commentedon Dec 28, 2023
hmm, but I don't see how Rugged allows me to pass a value for depth to fetch?
Bo98 commentedon May 23, 2024
#980 should address this
heyvito commentedon Dec 12, 2024
I think this issue should still be open as #980 has not been merged.
The following snippet is way slower than running
git clone --depth 1
:Option is not being handled by
rugged/ext/rugged/rugged_repo.c
Lines 536 to 608 in 010e611
and
rugged/ext/rugged/rugged_repo.c
Lines 514 to 534 in 010e611
bwitt commentedon May 12, 2025
sounds like this issue should still be open, as #980 is not merged. @benbalter what do you think?
bwitt commentedon May 15, 2025
@carlosmn would you be able to reopen this? this is not yet resolved (needs #980 )