[PATCH v3 12/13] setup: rename "init.defaultRefFormat" to "init.defaultRefStorageFormat"
From: Patrick Steinhardt <hidden>
Date: 2026-09-09 11:13:28
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.defaultRefStorageFormat" 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 | 4 +++- setup.c | 8 +++++--- t/t0001-init.sh | 16 ++++++++-------- 5 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc
index 73bb939359..c2cef3f528 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.defaultRefStorageFormat" 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..e258770591 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.defaultRefStorageFormat=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 f82fcf25e6..e45bd692db 100644
--- a/Documentation/config/init.adoc
+++ b/Documentation/config/init.adoc@@ -13,11 +13,13 @@ 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.defaultRefStorageFormat`:: 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_STORAGE_FORMAT` environment variable take precedence over this config. +`init.defaultRefFormat`:: + Deprecated alias of `init.defaultRefStorageFormat`. init.defaultSubmodulePathConfig:: A boolean that specifies if `git init` and `git clone` should
diff --git a/setup.c b/setup.c
index 621cf87c9c..df8cbf196d 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.defaultrefstorageformat") || + !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.defaultRefStorageFormat" takes precedence over this setting. */ if (!strcmp(key, "feature.experimental") && cfg->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN &&
@@ -2784,7 +2785,8 @@ static void repository_format_configure(struct repository_format *repo_fmt, * 5. Its deprecated equivalent "GIT_DEFAULT_REF_FORMAT". * * 6. The default ref storage format for new repositories as - * configured via "init.defaultRefFormat" + * configured via "init.defaultRefStorageFormat" or its deprecated + * equivalent "init.defaultRefFormat". * * 7. 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 af9a7ba958..fe5bc3d3e1 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh@@ -659,9 +659,9 @@ test_expect_success 'GIT_REF_STORAGE_FORMAT refuses to reinitialize with differe test_cmp expect err ' -test_expect_success 'init warns about invalid init.defaultRefFormat' ' +test_expect_success 'init warns about invalid init.defaultRefStorageFormat' ' test_when_finished "rm -rf repo" && - test_config_global init.defaultRefFormat garbage && + test_config_global init.defaultRefStorageFormat 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.defaultRefStorageFormat=$format" ' test_when_finished "rm -rf refformat" && - test_config_global init.defaultRefFormat $format && + test_config_global init.defaultRefStorageFormat $format && ( sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT && git init refformat
@@ -753,9 +753,9 @@ test_expect_success "--ref-storage-format= overrides GIT_DEFAULT_REF_STORAGE_FOM test_cmp expect actual ' -test_expect_success "GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefFormat" ' +test_expect_success "GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefStorageFormat" ' test_when_finished "rm -rf refformat" && - test_config_global init.defaultRefFormat files && + test_config_global init.defaultRefStorageFormat files && GIT_DEFAULT_REF_STORAGE_FORMAT=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.defaultRefStorageFormat 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.defaultRefStorageFormat files && ( sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT && git init refformat
--
2.55.0.1074.ge7621b4bad.dirty