Skip to content

Improve errors when we are trying to access a git repository with partial history (+ fix fetchGit on these repos) (backport #13265) #13266

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

Open
wants to merge 3 commits into
base: 2.28-maintenance
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 26, 2025

Motivation

This is a subset of #13260 but doesn't change the default behavior for flake urls, so it can be backported.

Error fixed by this PR:

error:
       … while calling the 'fetchGit' builtin
         at «string»:1:2:
            1| (builtins.fetchGit { url = "file:///tmp/nix-test/main/fetchGitShallow/shallow-worktree"; shallow = true; }).rev
             |  ^

       … while fetching the input 'git+file:///tmp/nix-test/main/fetchGitShallow/shallow-worktree?exportIgnore=1&shallow=1'

       error: getting parent of Git commit 'b84683a868d74413ba54bd3c7da8bd57a94a8c8a': object not found - no match for id (cfad7cc96b05c722c83ea7c41269a6910c0a2020)

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.


This is an automatic backport of pull request #13265 done by [Mergify](https://mergify.com).

Mic92 added 3 commits May 26, 2025 12:54
This can never work and leads to a crash bug.

(cherry picked from commit 0479db9)

# Conflicts:
#	src/libfetchers/git.cc
Before we got something like this but only inside the VM test:

 vm-test-run-functional-tests-on-nixos_user> machine # fetchGit.sh: line 286: unexpected EOF while looking for matching `)'

We now try to do not too much in a single line, so that the bash parser does not get confused.
This also seems more readable and better quoted.

(cherry picked from commit 5419d82)
@mergify mergify bot added the automatic backport This PR is a backport produced by automation (does not trigger backporting) label May 26, 2025
@mergify mergify bot requested a review from edolstra as a code owner May 26, 2025 12:54
Copy link
Contributor Author

mergify bot commented May 26, 2025

Cherry-pick of 0479db9 has failed:

On branch mergify/bp/2.28-maintenance/pr-13265
Your branch is up to date with 'origin/2.28-maintenance'.

You are currently cherry-picking commit 0479db934.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/libfetchers/git.cc

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added with-tests Issues related to testing. PRs with tests have some priority fetching Networking with the outside (non-Nix) world, input locking labels May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automatic backport This PR is a backport produced by automation (does not trigger backporting) conflicts fetching Networking with the outside (non-Nix) world, input locking merge-queue with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant