nix icon indicating copy to clipboard operation
nix copied to clipboard

Repositories created by newer version of git not supported (`reftable` ref format).

Open yshui opened this issue 2 weeks ago • 6 comments

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


Add :+1: to issues you find important.

yshui avatar Dec 05 '25 12:12 yshui

  • Blocked on https://github.com/libgit2/libgit2/pull/7117

Looks like we need to help them out.

roberth avatar Dec 05 '25 12:12 roberth

We should probably pass --ref-format=files when calling git fetch.

edolstra avatar Dec 05 '25 12:12 edolstra

We don't control that for local user repositories though.

roberth avatar Dec 05 '25 12:12 roberth

Can't do much about those.

edolstra avatar Dec 05 '25 12:12 edolstra

This issue affects devenv usage in theese repos too

qweered avatar Dec 11 '25 16:12 qweered

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.

roberth avatar Dec 11 '25 21:12 roberth

git refs migrate

thanks for this! i've been cloning git repos back-and-forth to convert the ref formats 😅

yshui avatar Dec 12 '25 16:12 yshui