libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Shallow clone support

Open dougrathbone opened this issue 13 years ago • 23 comments

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)

dougrathbone avatar Oct 20 '12 00:10 dougrathbone

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.

ben avatar Oct 20 '12 01:10 ben

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:

  • http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg00512.html

dougrathbone avatar Dec 02 '12 04:12 dougrathbone

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?

dunmatt avatar Nov 13 '14 19:11 dunmatt

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?

nulltoken avatar Nov 13 '14 19:11 nulltoken

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 [email protected] 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.

ethomson avatar Nov 15 '14 14:11 ethomson

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'

AmadeusW avatar Nov 27 '14 23:11 AmadeusW

Appears the recent discussion is here : https://github.com/libgit2/libgit2/issues/3058

burdges avatar Jun 17 '15 16:06 burdges

This issue is now nearly 8 years old. The corresponding issue at https://github.com/libgit2/libgit2/issues/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 😄

litetex avatar May 31 '20 19:05 litetex

Any progress on this issue?

tschissler avatar Feb 26 '21 09:02 tschissler

Is this on the horizon?

PGoodeBDO avatar Mar 28 '22 23:03 PGoodeBDO

any progress here guys? this ticket is 11 years old

shaybenh7 avatar Apr 04 '23 15:04 shaybenh7

With this merged https://github.com/libgit2/libgit2/pull/6396, then it should be feasable to add to libgit2sharp

hoerup avatar May 09 '23 21:05 hoerup

Legendary 🥇

painhardcore avatar May 10 '23 00:05 painhardcore

wait 11 years

DUWENINK avatar Jul 06 '23 07:07 DUWENINK

🤷‍♂️ bump and +1 here.

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

RyanGaudion avatar Jul 11 '23 14:07 RyanGaudion

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

libgit2 has made a new release including the shallow clone feature

hoerup avatar Jul 19 '23 07:07 hoerup

@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?

Regenhardt avatar Aug 18 '23 13:08 Regenhardt

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

AlessandroLenzo avatar Sep 25 '23 08:09 AlessandroLenzo

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.

Regenhardt avatar Sep 25 '23 13:09 Regenhardt

+1

jkiebzak avatar Nov 02 '23 14:11 jkiebzak

@bording is it correct to assume that this ticket is solved with https://github.com/libgit2/libgit2sharp/pull/2066/commits/cd6936506ca7808c2fab7454fe5df95c99188d2d ??

hoerup avatar Nov 27 '23 09:11 hoerup

@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.

bording avatar Nov 27 '23 15:11 bording

Shallow cloning would be amazing..,

omdathetkan avatar Nov 27 '23 21:11 omdathetkan