Re: [PATCH] refs: support migration with worktrees
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2025, 14:47 UTC
- Message-ID
- <xmqqzf99ahop.fsf@gitster.g>
- In-Reply-To
- <aQHoKXtrbDx6eNpH@pks.im>
Patrick Steinhardt <ps@pks.im> 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.