Describe the bug
The current version of Nix (2.33.0) is not compatible with git relative workspaces introduced in 2.48.0. This is likely due to libgit2 not supporting the extension.
I don't think there's much to do, other than waiting for libgit2 catching up with git stable versions, and recommend to avoid the feature. I just wanted to add the issue to warn anybody else stumbling into the issue, and how to revert to absolute worktrees as workaround.
Steps To Reproduce
Make sure you're using git version greater or equal than 2.48.0.
- Create a git repo with a nix configuration
nix flake new --template 'templates#bash-hello' test
git -C test init && git -C test add . && git -C test commit -m "Initial commit"
- Verify that's working as expected:
git -C test config --local --list
nix run ./test
- Add a relative worktree:
git -C test worktree add --relative-paths -b dev ../test.worktrees/dev
- Now you get the error
git -C test config --local --list
nix run ./test
The error should be something like
error:
… while fetching the input 'git+file:///.../test'
error: opening Git repository "/.../test": unsupported extension name extensions.relativeworktrees
Note the new line extensions.relativeworktrees=true in the local configuration.
Getting rid of relative worktree configuration will fix the problem:
git -C test.worktrees/dev worktree repair --no-relative-paths
git -C test config unset --local extensions.relativeworktrees
nix run ./test
Expected behavior
nix should work with features of the stable versions of git
Metadata
nix-env (Determinate Nix 3.15.1) 2.33.0
Additional context
Checklist
Add 👍 to issues you find important.
Describe the bug
The current version of Nix (2.33.0) is not compatible with git relative workspaces introduced in
2.48.0. This is likely due tolibgit2not supporting the extension.I don't think there's much to do, other than waiting for
libgit2catching up withgitstable versions, and recommend to avoid the feature. I just wanted to add the issue to warn anybody else stumbling into the issue, and how to revert to absolute worktrees as workaround.Steps To Reproduce
Make sure you're using
gitversion greater or equal than2.48.0.git -C test config --local --list nix run ./testgit -C test worktree add --relative-paths -b dev ../test.worktrees/devgit -C test config --local --list nix run ./testextensions.relativeworktrees=truein the local configuration.Getting rid of relative worktree configuration will fix the problem:
Expected behavior
nix should work with features of the stable versions of git
Metadata
Additional context
Checklist
Add 👍 to issues you find important.