Skip to content

Revert "fetchTree: shallow git fetching by default" - #11172

Closed
roberth wants to merge 1 commit into
masterfrom
revert-shallow-by-default
Closed

roberth wants to merge 1 commit into
masterfrom
revert-shallow-by-default

Conversation

@roberth

@roberth roberth commented Jul 24, 2024

Copy link
Copy Markdown
Member

It was noted in #11012 that this approach does not work for all Git servers. This could be revisited by evaluating the performance cost of attempting to fetch shallowly first, and non-shallowly as a fallback.
Failing when our shallow fetching strategy is not supported by the remote is unfortunately not acceptable.

This reverts commit 358c26f.

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.

It was noted in #11012
that this approach does not work for all Git servers.
This could be revisited by evaluating the performance cost
of attempting to fetch shallowly first, and non-shallowly
as a fallback.
Failing when our shallow fetching strategy is not supported
by the remote is unfortunately not acceptable.

This reverts commit 358c26f.
@roberth
roberth requested a review from edolstra as a code owner July 24, 2024 20:07
@roberth roberth added bug fetching Networking with the outside (non-Nix) world, input locking labels Jul 24, 2024
@roberth roberth added this to the nix-2.24 milestone Jul 25, 2024
@roberth

roberth commented Jul 29, 2024

Copy link
Copy Markdown
Member Author

Discussed in meeting:

  • Failure is bad UX
    Possible mitigations:
    • Revert shallow-by-default (this PR)
    • Retry the specific error non-shallowly
  • Shallow affects the output attribute revCount, which requires a full history and is often not used.
    Possible mitigations:
    • Keep shallow-by-default behavior
    • Make revCount lazy
      • Not good enough for lock files, which are data => strict
      • Non-trivial in the current fetching infrastructure

Decision:
Close this PR and fix the bug by retrying as if shallow = false;.

@roberth roberth closed this Jul 29, 2024
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-07-29-nix-team-meeting-minutes-165/49970/1

@Ericson2314
Ericson2314 deleted the revert-shallow-by-default branch October 15, 2025 05:14
roberth added a commit to roberth/nix that referenced this pull request Jan 11, 2026
Document the design space around the `shallow` parameter, including:
- The three behaviors it can control (tolerate, perform, adjust attrs)
- Server compatibility issues (allowReachableSHA1InWant)
- Complete timeline from 2018-2025 with key decisions
- Current state: shallow-by-default still in effect, fallback never implemented
- Summary of contributor opinions and design considerations

This documents the finding that PR NixOS#11172 (revert) was closed in favor
of implementing a fallback, but the fallback was never implemented,
leaving Nix 2.23+ with shallow-by-default and no recovery path for
incompatible servers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fetching Networking with the outside (non-Nix) world, input locking

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants