Subject: Re: [PATCH] refs: support migration with worktrees

From: Junio C Hamano <[email-masked]>
Date: Wed, 29 Oct 2025 07:47:18 -0700

Patrick Steinhardt <[email-masked]> writes:

> The problem we have here is backwards compatibility. Right now we assume
> that `extensions.refStorage` applies to all worktrees, so if we wanted
> to change it like you propose then we'd have to introduce a backwards
> incompatible change.

That settles it.  If we have long declared that a set of worktrees
attached to a repository share the same backend, then we do not have
to worry about overlaying refs stored in a different backend on top
of the base set of refs at all.  That simplifies things a lot, I
would imagine.

> So with the above reasoning I'm not sure I'd call this a limitation.
> It's rather a mechanism to protect users from unexpected consequences.

The need for that mechanism would imply that it may not be clear to
the users that worktrees of the same repository must use the same
ref backend.  Some education is needed, and erroring this operation
out may be one of the ways to give that, perhaps.

Thanks.