From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Patrick Steinhardt <ps@pks.im>, git@vger.kernel.org
Cc: Karthik Nayak <karthik.188@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 09/11] setup: rename ref storage format environment variables
Date: Wed, 9 Sep 2026 13:40:07 +0530 [thread overview]
Message-ID: <57f08562-ecea-4e51-8e5a-ae3aa91b23d1@gmail.com> (raw)
In-Reply-To: <20260907-b4-pks-unify-ref-storage-format-v2-9-6733c90ca5b0@pks.im>
On 9/7/26 16:48, Patrick Steinhardt wrote:
>
> diff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc
> index a048f0bddc..f82fcf25e6 100644
> --- a/Documentation/config/init.adoc
> +++ b/Documentation/config/init.adoc
> @@ -16,7 +16,7 @@ endif::[]
> `init.defaultRefFormat`::
> Allows overriding the default ref storage format for new repositories.
> See `--ref-storage-format=` in linkgit:git-init[1]. Both the command line
> - option and the `GIT_DEFAULT_REF_FORMAT` environment variable take
> + option and the `GIT_DEFAULT_REF_STORAGE_FORMAT` environment variable take
> precedence over this config.
>
> init.defaultSubmodulePathConfig::
> diff --git a/Documentation/git.adoc b/Documentation/git.adoc
> index 23ba65656e..d78e2b5c10 100644
> --- a/Documentation/git.adoc
> +++ b/Documentation/git.adoc
> @@ -590,15 +590,15 @@ double-quotes and respecting backslash escapes. E.g., the value
> is always used. The default is "sha1".
> See `--object-format` in linkgit:git-init[1].
>
> -`GIT_DEFAULT_REF_FORMAT`::
> - If this variable is set, the default reference backend format for new
> +`GIT_DEFAULT_REF_STORAGE_FORMAT`::
> + If this variable is set, the default ref storage format for new
> repositories will be set to this value. The default is "files".
> See `--ref-storage-format` in linkgit:git-init[1].
>
> -`GIT_REFERENCE_BACKEND`::
> - Specify which reference backend to be used along with its URI.
> - See `extensions.refStorage` option in linkgit:git-config[1] for more
> - details. Overrides the config variable when used.
> +`GIT_REF_STORAGE_FORMAT`::
> + Specify which ref storage format to use along with its URI.
> + See `extensions.refStorage` option in linkgit:git-config[1] for more
> + details. Overrides the config variable when used.
>
Given rationale about retaining the documentation discussed in another
mail in this thread, I think we could do so here too.
> @@ -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?
> } else if (repo_fmt->version >= 0) {
> ref_storage_format = repo_fmt->ref_storage_format;
> ref_storage_payload = xstrdup_or_null(repo_fmt->ref_storage_payload);
> - } else if ((env = getenv("GIT_DEFAULT_REF_FORMAT"))) {
> + } else if (((env = getenv("GIT_DEFAULT_REF_STORAGE_FORMAT")) ||
> + (env = getenv("GIT_DEFAULT_REF_FORMAT")))) {
> ref_storage_format = ref_storage_format_by_name(env);
> if (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
> die(_("unknown ref storage format specified via %s: '%s'"),
> - "GIT_DEFAULT_REF_FORMAT", env);
> + "GIT_DEFAULT_REF_STORAGE_FORMAT", env);
Ditto here.
> 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?
--
Sivaraam
next prev parent reply other threads:[~2026-09-09 8:10 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 10:36 [PATCH 00/11] Fix inconsistent ref storage format terminology Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 01/11] builtin/init: rename "--ref-format=" to "--ref-storage=" Patrick Steinhardt
2026-09-04 13:05 ` Karthik Nayak
2026-09-07 10:00 ` Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 02/11] builtin/clone: " Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 03/11] builtin/refs: " Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 04/11] builtin/submodule: " Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 05/11] builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage" Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 06/11] help: rename "default-ref-format" to "default-ref-storage" Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 07/11] refs: expose function to parse reference URIs Patrick Steinhardt
2026-09-04 13:12 ` Karthik Nayak
2026-09-04 10:36 ` [PATCH 08/11] setup: refactor how we configure the ref storage format Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 09/11] setup: rename ref storage format environment variables Patrick Steinhardt
2026-09-04 13:20 ` Karthik Nayak
2026-09-07 10:00 ` Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 10/11] setup: rename "init.defaultRefFormat" to "init.defaultRefStorage" Patrick Steinhardt
2026-09-04 10:36 ` [PATCH 11/11] setup: allow "git init --ref-storage=" to specify a payload Patrick Steinhardt
2026-09-04 13:23 ` [PATCH 00/11] Fix inconsistent ref storage format terminology Karthik Nayak
2026-09-04 17:15 ` Junio C Hamano
2026-09-07 10:00 ` Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 " Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 01/11] builtin/init: rename "--ref-format=" to "--ref-storage-format=" Patrick Steinhardt
2026-09-08 9:01 ` Kaartic Sivaraam
2026-09-09 7:00 ` Patrick Steinhardt
2026-09-09 9:14 ` Kaartic Sivaraam
2026-09-07 11:18 ` [PATCH v2 02/11] builtin/clone: " Patrick Steinhardt
2026-09-08 9:21 ` Kaartic Sivaraam
2026-09-09 7:03 ` Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 03/11] builtin/refs: " Patrick Steinhardt
2026-09-08 10:55 ` Kaartic Sivaraam
2026-09-09 7:03 ` Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 04/11] builtin/submodule: " Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 05/11] builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage-format" Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 06/11] help: rename "default-ref-format" to "default-ref-storage-format" Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 07/11] refs: expose function to parse reference URIs Patrick Steinhardt
2026-09-08 13:47 ` Kaartic Sivaraam
2026-09-09 7:03 ` Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 08/11] setup: refactor how we configure the ref storage format Patrick Steinhardt
2026-09-09 8:00 ` Kaartic Sivaraam
2026-09-09 9:23 ` Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 09/11] setup: rename ref storage format environment variables Patrick Steinhardt
2026-09-09 8:10 ` Kaartic Sivaraam [this message]
2026-09-09 9:23 ` Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 10/11] setup: rename "init.defaultRefFormat" to "init.defaultRefStorageFormat" Patrick Steinhardt
2026-09-07 11:18 ` [PATCH v2 11/11] setup: allow "git init --ref-storage-format=" to specify a payload Patrick Steinhardt
2026-09-09 8:54 ` Kaartic Sivaraam
2026-09-09 9:23 ` Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 00/13] Fix inconsistent ref storage format terminology Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 01/13] parse-options: allow for hidden aliases Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 02/13] builtin/init: rename "--ref-format=" to "--ref-storage-format=" Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 03/13] builtin/clone: " Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 04/13] builtin/refs: " Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 05/13] builtin/submodule: " Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 06/13] builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage-format" Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 07/13] help: rename "default-ref-format" to "default-ref-storage-format" Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 08/13] refs: expose function to parse reference URIs Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 09/13] setup: refactor how we configure the ref storage format Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 10/13] setup: rename ref storage format environment variables Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 11/13] t: rename GIT_TEST_DEFAULT_REF_FORMAT Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 12/13] setup: rename "init.defaultRefFormat" to "init.defaultRefStorageFormat" Patrick Steinhardt
2026-09-09 11:12 ` [PATCH v3 13/13] setup: allow "--ref-storage-format=" to specify a payload Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57f08562-ecea-4e51-8e5a-ae3aa91b23d1@gmail.com \
--to=kaartic.sivaraam@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=karthik.188@gmail.com \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox