LibGit2: expose the depth option to clone and fetch#60024
LibGit2: expose the depth option to clone and fetch#60024KristofferC merged 2 commits intomasterfrom
Conversation
why use many commits when few do trick?
|
It's been mentioned in the past (I can dig up the links) that GitHub doesn't like people doing shallow clones, and has asked others (Homebrew) to stop doing shallow clones. IIRC, the initial shallow clone isn't the problem; the problem is that subsequent fetches are very expensive on GitHub's servers. That was in the context of Homebrew's usage of shallow clones. I don't know if our usage pattern is the same or different, so I don't know if the same admonishment applies to us here. |
|
Our pattern is way different. And that's a discussion more for Pkg, the option is nice to have available here anyway. |
stdlib/LibGit2/src/LibGit2.jl
Outdated
| * `depth::Integer=0`: create a shallow clone with a history truncated to the | ||
| specified number of commits. `0` indicates a full clone (the default). | ||
| Use `Consts.FETCH_DEPTH_UNSHALLOW` to fetch all missing data from a shallow clone. | ||
| Note: shallow clones are only supported for network protocols (http, https, git, ssh), not for local filesystem paths. |
There was a problem hiding this comment.
Add a link to the upstream bug for this as a reference so people in the future can re-check whether this is still true? libgit2/libgit2#6634
(cherry picked from commit d484e19)
I want to use this in Pkg, e.g. when cloning a registry or a package in pkg add.
Written by Claude Code 🤖