From: Patrick Steinhardt Date: Wed, 09 Sep 2026 09:23:28 GMT Subject: Re: [PATCH v2 09/11] setup: rename ref storage format environment variables Message-ID: In-Reply-To: <57f08562-ecea-4e51-8e5a-ae3aa91b23d1@gmail.com> On Wed, Sep 09, 2026 at 01:40:07PM +0530, Kaartic Sivaraam wrote: > On 9/7/26 16:48, Patrick Steinhardt wrote: > > @@ -2785,19 +2788,21 @@ static void repository_format_configure(struct repository_format *repo_fmt, > > */ > > if (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) { > > /* nothing to do */ > > - } else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) { > > + } else if (((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT)) || > > + (env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT)))) { > > ref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload); > > if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN) > > die(_("unknown ref storage format specified via %s: '%s'"), > > - GIT_REFERENCE_BACKEND_ENVIRONMENT, env); > > + GIT_REF_STORAGE_FORMAT_ENVIRONMENT, env); > > We're getting the value from GIT_REFERENCE_BACKEND_ENVIRONMENT as a fallback > but we are mentioning only GIT_REF_STORAGE_FORMAT_ENVIRONMENT in the error > message. Would this not be misleading if the value actually comes from > GIT_REFERENCE_BACKEND_ENVIRONMENT? Yeah, fair. I already had this on my radar, but thought that the solution was a bit too ugly because it resulted in a bit of duplication. I was thus sweeping this under the rug a bit, if I'm being totally honest. Anyway, will adapt. > > diff --git a/t/test-lib.sh b/t/test-lib.sh > > index 1f0505e412..60a2179a0a 100644 > > --- a/t/test-lib.sh > > +++ b/t/test-lib.sh > > @@ -575,8 +575,8 @@ export EDITOR > > GIT_TEST_BUILTIN_HASH=$("$GIT_BINARY" version --build-options | sed -ne 's/^default-hash: //p') > > GIT_DEFAULT_HASH="${GIT_TEST_DEFAULT_HASH:-$GIT_TEST_BUILTIN_HASH}" > > export GIT_DEFAULT_HASH > > -GIT_DEFAULT_REF_FORMAT="${GIT_TEST_DEFAULT_REF_FORMAT:-files}" > > -export GIT_DEFAULT_REF_FORMAT > > +GIT_DEFAULT_REF_STORAGE_FORMAT="${GIT_TEST_DEFAULT_REF_FORMAT:-files}" > > +export GIT_DEFAULT_REF_STORAGE_FORMAT > > Would it make sense to also rename GIT_TEST_DEFAULT_REF_FORMAT to > GIT_TEST_DEFAULT_REF_STORAGE_FORMAT for consistency sake? Oh, that one I completely missed. Good catch, thanks! Patrick