Repositories created by newer version of git not supported (`reftable` ref format).
Describe the bug
error:
… while fetching the input 'git+file:///tmp/repo'
error: opening Git repository "/tmp/repo": unsupported extension name extensions.refstorage
I can't find anything in git's release notes indicating reftable has become the default, but for some reason all my new git repos start to use reftable.
Steps To Reproduce
Clone a flake repo (to explicitly choose ref format, use git clone --ref-format=reftable), run nix build.
Expected behavior
Builds
Metadata
nix-env (Nix) 2.31.2
Additional context
Checklist
- [ ] checked latest Nix manual (source)
- [ ] checked open bug issues and pull requests for possible duplicates
Add :+1: to issues you find important.
- Blocked on https://github.com/libgit2/libgit2/pull/7117
Looks like we need to help them out.
We should probably pass --ref-format=files when calling git fetch.
We don't control that for local user repositories though.
Can't do much about those.
This issue affects devenv usage in theese repos too
It seems that you can work around this by migrating a repo back to files and calling git refs migrate. Does that work for you?
Possible mitigation: have Nixpkgs (or NixOS, Home Manager) disable this feature by default
Intermediate solution: use the git CLI for refs operations, of which Nix does not perform very many, and they are presumably easy to replace, unlike the trees and blobs which serve a critical role. It's a step back on https://github.com/NixOS/nix/issues/9807 but that's acceptable tech debt. I think it could replace libgit2 refs because we already/still have a critical dependency on git fetch anyway that Nix is also not getting rid of anytime soon.
git refs migrate
thanks for this! i've been cloning git repos back-and-forth to convert the ref formats 😅