Re: [PATCH 3/9] setup: don't apply "GIT_REFERENCE_BACKEND" without a repository
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 12, 2026, 06:18 UTC
- Message-ID
- <aiukox1_HrWFxnS_@pks.im>
- In-Reply-To
- <xmqqa4t2wbb5.fsf@gitster.g>
On Wed, Jun 10, 2026 at 10:32:46AM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > When discovering a repository we eventually also apply the > > "GIT_REFERENCE_BACKEND" environment variable to the repository. There's > > two problems with that: > > > > - We do this unconditionally, which is rather pointless: we really > > only have to configure the repository when we have found one. > > > > - We have already applied the repository format at that point in time, > > so we need to manually reapply it. > > Does the second point have a small typo, i.e., "if we have a > repository, we have already applied the ref backend to it when we > discovered it, so NO need to manually reapply"?
No, this is correct as-is. At the point in time where we handle GIT_REFERENCE_BACKEND we have already discovered the repository format, applied it to the repository, configured the reference database format et al. So because we handle GIT_REFERENCE_BACKEND _after_ that whole dance we basically have to re-configure the reference database format, which is awkward.
Patrick