fetchTree/fetchGit: re-enable shallow fetching#9811
Merged
thufschmitt merged 1 commit intoNixOS:masterfrom Jan 19, 2024
Merged
Conversation
roberth
reviewed
Jan 19, 2024
| && {repo.git} push origin --all | ||
| """) | ||
|
|
||
| # memoize the revisions |
Member
There was a problem hiding this comment.
Suggested change
| # memoize the revisions | |
| # save the revision |
Not lazy.
| gitea.succeed(f""" | ||
| git init --bare -b main /root/{self.name} | ||
| git init --bare -b main /root/{self.name} \ | ||
| && git config --global uploadpack.allowAnySHA1InWant true |
Member
There was a problem hiding this comment.
What is the purpose of uploadpack.allowAnySHA1InWant here; could you add a comment?
I assume it's not a problem for Nix users because this happens on the gitea host for some initialization purpose - not on a clone that is a normal client.
Member
Author
There was a problem hiding this comment.
I removed this line.
I thought we need this setting to enable shallow cloning via ssh by revision, but it seems it's not needed.
Add several tests for git fetching: - shallow-cache-separation: can fetch the same repo shallowly and non-shallowly - shallow-ignore-ref: ensure that ref gets ignored when shallow=true is set - ssh-shallow: can fetch a git repo via ssh using shallow=1
Member
|
Discussed during the maintainers meeting today. Good to go 🚀 Details- @edolstra: Worried that this entranches us in a Git-cli specific behavior and makes it harder to move to libGit2 - @thufschmitt: It's quite unlikely that we'll be able to use libgit everywhere given the missing features. So it shouldn't be too much of a problem - That leaves us with 2 dependencies for the same thing, but probably won't be avoidable because lazy trees isn't really implementable with the Git cli - @Ericson2314: Could we add the missing features in libgit2? - ~500 lines of python elsewhere; probably more C++ needed, and it's security sensitive... Too much effort to make this a priority - @edolstra: We could also not support credential helpers at all - But would be really annoying for a number of users
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-01-19-nix-team-meeting-minutes-116/38837/1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Add back shallow fetching after it has been removed by #9806
based on #9806
Context
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.