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

fetchGit should do shallow fetches when possible #1837

Closed
shlevy opened this issue Feb 2, 2018 · 6 comments
Closed

fetchGit should do shallow fetches when possible #1837

shlevy opened this issue Feb 2, 2018 · 6 comments
Assignees

Comments

@shlevy
Copy link
Member

shlevy commented Feb 2, 2018

Especially as many git servers, including github, have allowReachableSHA1InWant, fetchGit should just try fetching the specific rev or the HEAD of the specific ref first, and only then fall back to a fuller fetch.

@edolstra
Copy link
Member

edolstra commented Feb 3, 2018

Are shallow fetches incremental? I.e. if I do a shallow fetch, then the repo receives a few new commits, and I do another shallow fetch, will it fetch only the delta?

@shlevy
Copy link
Member Author

shlevy commented Feb 3, 2018

Yep

@shlevy shlevy added the backlog label Apr 1, 2018
@shlevy shlevy self-assigned this Apr 1, 2018
@kalbasit
Copy link
Member

@shlevy I see this in the backlog, in other words, it's stalled for now? Would you accept a pull request for it?

ajs124 added a commit to helsinki-systems/nix that referenced this issue Mar 4, 2019
This was brought up in NixOS#1837 and seems sensible.

The issue talks about implementing a fallback, in case a shallow fetch
fails. This was not implemented so far, because I have not yet run into
a situation where it was necessary.
@edolstra
Copy link
Member

edolstra commented Jul 1, 2020

Shallow clones are now supported. However we can't make it the default because it would break the revCount attribute.

@edolstra edolstra closed this as completed Jul 1, 2020
@coderfromhere
Copy link

Documentation doesn't show how to enable shallow cloning, is there a human-readable example of it?

@CohenCyril
Copy link

Hi, can one tell me in which version of nix is the attribute shallow accepted by fetchGit?

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

No branches or pull requests

6 participants