[PATCH 10/11] setup: rename "init.defaultRefFormat" to "init.defaultRefStorage"
From: Patrick Steinhardt <hidden>
Date: 2026-09-04 10:36:39
Subsystem:
documentation, the rest · Maintainers:
Jonathan Corbet, Linus Torvalds
With the same reasoning as for git-init(1), rename the "init.defaultRefFormat" config option to "init.defaultRefStorage" and keep the old name as an alias. Signed-off-by: Patrick Steinhardt <redacted> --- Documentation/BreakingChanges.adoc | 2 +- Documentation/config/feature.adoc | 2 +- Documentation/config/init.adoc | 2 +- setup.c | 8 +++++--- t/t0001-init.sh | 16 ++++++++-------- 5 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc
index 73bb939359..af69f5c1e2 100644
--- a/Documentation/BreakingChanges.adoc
+++ b/Documentation/BreakingChanges.adoc@@ -156,7 +156,7 @@ Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zombino.com>, "packed-refs" file. + Users that get immediate benefit from the "reftable" backend could continue to -opt-in to the "reftable" format manually by setting the "init.defaultRefFormat" +opt-in to the "reftable" format manually by setting the "init.defaultRefStorage" config. But defaults matter, and we think that overall users will have a better experience with less platform-specific quirks when they use the new backend by default.
diff --git a/Documentation/config/feature.adoc b/Documentation/config/feature.adoc
index 924f5ff4e3..7687e1a89a 100644
--- a/Documentation/config/feature.adoc
+++ b/Documentation/config/feature.adoc@@ -25,7 +25,7 @@ reusing objects from multiple packs instead of just one. significantly smaller in the presence of certain filename collisions with Git's default name-hash. + -* `init.defaultRefFormat=reftable` causes newly initialized repositories to use +* `init.defaultRefStorage=reftable` causes newly initialized repositories to use the reftable format for storing references. This new format solves issues with case-insensitive filesystems, compresses better and performs significantly better with many use cases. Refer to Documentation/technical/reftable.adoc for
diff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc
index 3098e033ac..297c09cf43 100644
--- a/Documentation/config/init.adoc
+++ b/Documentation/config/init.adoc@@ -13,7 +13,7 @@ endif::[] `--object-format=` in linkgit:git-init[1]. Both the command line option and the `GIT_DEFAULT_HASH` environment variable take precedence over this config. -`init.defaultRefFormat`:: +`init.defaultRefStorage`:: Allows overriding the default ref storage format for new repositories. See `--ref-storage=` in linkgit:git-init[1]. Both the command line option and the `GIT_DEFAULT_REF_STORAGE` environment variable take
diff --git a/setup.c b/setup.c
index 5de2aa0d2f..b81d4f134a 100644
--- a/setup.c
+++ b/setup.c@@ -2697,7 +2697,8 @@ static int read_default_format_config(const char *key, const char *value, goto out; } - if (!strcmp(key, "init.defaultrefformat")) { + if (!strcmp(key, "init.defaultrefstorage") || + !strcmp(key, "init.defaultrefformat")) { ret = git_config_string(&str, key, value); if (ret) goto out;
@@ -2709,7 +2710,7 @@ static int read_default_format_config(const char *key, const char *value, /* * Enable the reftable format when "features.experimental" is enabled. - * "init.defaultRefFormat" takes precedence over this setting. + * "init.defaultRefStorage" takes precedence over this setting. */ if (!strcmp(key, "feature.experimental") && cfg->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN &&
@@ -2781,7 +2782,8 @@ static void repository_format_configure(struct repository_format *repo_fmt, * equivalent "GIT_DEFAULT_REF_FORMAT". * * 5. The default ref storage format for new repositories as - * configured via "init.defaultRefFormat" + * configured via "init.defaultRefStorage" or its deprecated + * equivalent "init.defaultRefFormat". * * 6. Otherwise, we fall back to the default ref storage format * compiled into Git.
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index e4b9fae8bd..b481d763ff 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh@@ -659,9 +659,9 @@ test_expect_success 'GIT_REF_STORAGE refuses to reinitialize with different stor test_cmp expect err ' -test_expect_success 'init warns about invalid init.defaultRefFormat' ' +test_expect_success 'init warns about invalid init.defaultRefStorage' ' test_when_finished "rm -rf repo" && - test_config_global init.defaultRefFormat garbage && + test_config_global init.defaultRefStorage garbage && echo "warning: unknown ref storage format ${SQ}garbage${SQ}" >expect && git init repo 2>err &&
@@ -714,9 +714,9 @@ do test_cmp expect actual ' - test_expect_success "init with init.defaultRefFormat=$format" ' + test_expect_success "init with init.defaultRefStorage=$format" ' test_when_finished "rm -rf refformat" && - test_config_global init.defaultRefFormat $format && + test_config_global init.defaultRefStorage $format && ( sane_unset GIT_DEFAULT_REF_STORAGE && git init refformat
@@ -753,9 +753,9 @@ test_expect_success "--ref-storage= overrides GIT_DEFAULT_REF_STORAGE" ' test_cmp expect actual ' -test_expect_success "GIT_DEFAULT_REF_STORAGE= overrides init.defaultRefFormat" ' +test_expect_success "GIT_DEFAULT_REF_STORAGE= overrides init.defaultRefStorage" ' test_when_finished "rm -rf refformat" && - test_config_global init.defaultRefFormat files && + test_config_global init.defaultRefStorage files && GIT_DEFAULT_REF_STORAGE=reftable git init refformat && echo reftable >expect &&
@@ -775,10 +775,10 @@ test_expect_success "init with feature.experimental=true" ' test_cmp expect actual ' -test_expect_success "init.defaultRefFormat overrides feature.experimental=true" ' +test_expect_success "init.defaultRefStorage overrides feature.experimental=true" ' test_when_finished "rm -rf refformat" && test_config_global feature.experimental true && - test_config_global init.defaultRefFormat files && + test_config_global init.defaultRefStorage files && ( sane_unset GIT_DEFAULT_REF_STORAGE && git init refformat
--
2.55.0.1007.g17ff1f9808.dirty