Skip to content

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

Closed
mergify[bot] wants to merge 3 commits into
2.29-maintenancefrom
mergify/bp/2.29-maintenance/pr-13265
Closed

Improve errors when we are trying to access a git repository with partial history (+ fix fetchGit on these repos) (backport #13265)#13267
mergify[bot] wants to merge 3 commits into
2.29-maintenancefrom
mergify/bp/2.29-maintenance/pr-13265

Conversation

@mergify

@mergify mergify Bot commented May 26, 2025

Copy link
Copy Markdown
Contributor

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 requested a review from edolstra as a code owner May 26, 2025 12:54
@mergify mergify Bot added automatic backport This PR is a backport produced by automation (does not trigger backporting) conflicts merge-queue labels May 26, 2025
@mergify

mergify Bot commented May 26, 2025

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 0479db9 has failed:

On branch mergify/bp/2.29-maintenance/pr-13265
Your branch is up to date with 'origin/2.29-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
@Mic92

Mic92 commented Sep 10, 2025

Copy link
Copy Markdown
Member

Closed because no one is catching up on all these backports.

@Mic92 Mic92 closed this Sep 10, 2025
@Mic92
Mic92 deleted the mergify/bp/2.29-maintenance/pr-13265 branch September 10, 2025 08:22
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