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
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.
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:
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?
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 😄
@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
@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?
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.
@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.
Activity
ben commentedon 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 commentedon Dec 2, 2012
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:
CanCloneShallowRepository.cssome updates on how JGit have been looking at it over the years:
dunmatt commentedon 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 commentedon Nov 13, 2014
Hey, that's great! We would be very pleased to help you work on this.
/cc @carlosmn @ethomson Thoughts?
ethomson commentedon Nov 15, 2014
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
AmadeusW commentedon Nov 27, 2014
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 commentedon Jun 17, 2015
Appears the recent discussion is here : libgit2/libgit2#3058
litetex commentedon 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 --unshallowbut with the API 😄tschissler commentedon Feb 26, 2021
Any progress on this issue?
PGoodeBDO commentedon Mar 28, 2022
Is this on the horizon?
shaybenh7 commentedon Apr 4, 2023
any progress here guys? this ticket is 11 years old
hoerup commentedon May 9, 2023
With this merged libgit2/libgit2#6396, then it should be feasable to add to libgit2sharp
painhardcore commentedon May 10, 2023
Legendary 🥇
DUWENINK commentedon Jul 6, 2023
wait 11 years
RyanGaudion commentedon Jul 11, 2023
🤷♂️ 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 commentedon 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 commentedon Aug 18, 2023
@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 commentedon Sep 25, 2023
Is this supported now or not? Not clear from here. Any code sample? Any documentation?
Please let us know, thanks.
Regenhardt commentedon Sep 25, 2023
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 commentedon Nov 2, 2023
+1
hoerup commentedon Nov 27, 2023
@bording is it correct to assume that this ticket is solved with cd69365 ??
bording commentedon 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 commentedon Nov 27, 2023
Shallow cloning would be amazing..,
dayadam commentedon Apr 7, 2025
This can be achieved with
cloneOptions.FetchOptions.CustomHeaders = new string[] { "git-clone-depth: 1" };