[PATCH 05/11] builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage"
From: Patrick Steinhardt <hidden>
Date: 2026-09-04 10:36:27
Subsystem:
documentation, the rest · Maintainers:
Jonathan Corbet, Linus Torvalds
With the same reasoning as for git-init(1), rename "--show-ref-format" to "--show-ref-storage" and keep the old name as an alias. Signed-off-by: Patrick Steinhardt <redacted> --- Documentation/git-rev-parse.adoc | 2 +- builtin/rev-parse.c | 2 +- contrib/completion/git-prompt.sh | 2 +- t/perf/perf-lib.sh | 4 ++-- t/t0001-init.sh | 36 +++++++++++++++++----------------- t/t0610-reftable-basics.sh | 16 +++++++-------- t/t1460-refs-migrate.sh | 4 ++-- t/t1500-rev-parse.sh | 8 ++++---- t/t5601-clone.sh | 2 +- t/t7424-submodule-mixed-ref-formats.sh | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/Documentation/git-rev-parse.adoc b/Documentation/git-rev-parse.adoc
index 5398691f3f..4c9dcc5652 100644
--- a/Documentation/git-rev-parse.adoc
+++ b/Documentation/git-rev-parse.adoc@@ -331,7 +331,7 @@ The following options are unaffected by `--path-format`: requested and no compatibility algorithm is enabled, prints an empty line. If not specified, the default is "storage". ---show-ref-format:: +--show-ref-storage:: Show the reference storage format used for the repository.
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 43693454d5..9822037884 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c@@ -1134,7 +1134,7 @@ int cmd_rev_parse(int argc, } continue; } - if (!strcmp(arg, "--show-ref-format")) { + if (!strcmp(arg, "--show-ref-format") || !strcmp(arg, "--show-ref-storage")) { puts(ref_storage_format_to_name(the_repository->ref_storage_format)); continue; }
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 6186c474ba..e8107e8325 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh@@ -466,7 +466,7 @@ __git_ps1 () local repo_info rev_parse_exit_code repo_info="$(git rev-parse --git-dir --is-inside-git-dir \ - --is-bare-repository --is-inside-work-tree --show-ref-format \ + --is-bare-repository --is-inside-work-tree --show-ref-storage \ --short HEAD 2>/dev/null)" rev_parse_exit_code="$?"
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 50a35545a1..b2826bc696 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh@@ -135,7 +135,7 @@ test_perf_create_repo_from () { source_git="$("$MODERN_GIT" -C "$source" rev-parse --git-dir)" objects_dir="$("$MODERN_GIT" -C "$source" rev-parse --git-path objects)" common_dir="$("$MODERN_GIT" -C "$source" rev-parse --git-common-dir)" - refformat="$("$MODERN_GIT" -C "$source" rev-parse --show-ref-format)" + refstorage="$("$MODERN_GIT" -C "$source" rev-parse --show-ref-storage)" objectformat="$("$MODERN_GIT" -C "$source" rev-parse --show-object-format)" mkdir -p "$repo/.git" (
@@ -153,7 +153,7 @@ test_perf_create_repo_from () { ) && ( cd "$repo" && - "$MODERN_GIT" init -q --ref-storage="$refformat" --object-format="$objectformat" && + "$MODERN_GIT" init -q --ref-storage="$refstorage" --object-format="$objectformat" && test_perf_do_repo_symlink_config_ && mv .git/hooks .git/hooks-disabled 2>/dev/null && if test -f .git/index.lock
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index bb3ec31097..26bd8c6822 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh@@ -657,7 +657,7 @@ test_expect_success 'init warns about invalid init.defaultRefFormat' ' git init repo 2>err && test_cmp expect err && - git -C repo rev-parse --show-ref-format >actual && + git -C repo rev-parse --show-ref-storage >actual && echo $GIT_DEFAULT_REF_FORMAT >expected && test_cmp expected actual '
@@ -669,7 +669,7 @@ test_expect_success 'default ref format' ' git init refformat ) && git version --build-options | sed -ne "s/^default-ref-format: //p" >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -692,7 +692,7 @@ do test_cmp expect actual && echo $format >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -700,7 +700,7 @@ do test_when_finished "rm -rf refformat" && git init --ref-storage=$format refformat && echo $format >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -713,7 +713,7 @@ do ) && echo $format >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -721,16 +721,16 @@ do test_when_finished "rm -rf refformat" && GIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage=$format refformat && echo $format >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual ' test_expect_success "reinit repository with GIT_DEFAULT_REF_FORMAT=$format does not change format" ' test_when_finished "rm -rf refformat" && git init refformat && - git -C refformat rev-parse --show-ref-format >expect && + git -C refformat rev-parse --show-ref-storage >expect && GIT_DEFAULT_REF_FORMAT=$format git init refformat && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual ' done
@@ -739,7 +739,7 @@ test_expect_success "--ref-storage= overrides GIT_DEFAULT_REF_FORMAT" ' test_when_finished "rm -rf refformat" && GIT_DEFAULT_REF_FORMAT=files git init --ref-storage=reftable refformat && echo reftable >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -749,7 +749,7 @@ test_expect_success "GIT_DEFAULT_REF_FORMAT= overrides init.defaultRefFormat" ' GIT_DEFAULT_REF_FORMAT=reftable git init refformat && echo reftable >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -761,7 +761,7 @@ test_expect_success "init with feature.experimental=true" ' git init refformat ) && echo reftable >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -774,7 +774,7 @@ test_expect_success "init.defaultRefFormat overrides feature.experimental=true" git init refformat ) && echo files >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -783,7 +783,7 @@ test_expect_success "GIT_DEFAULT_REF_FORMAT= overrides feature.experimental=true test_config_global feature.experimental true && GIT_DEFAULT_REF_FORMAT=files git init refformat && echo files >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -794,7 +794,7 @@ do git init --ref-storage=$from_format refformat && git init --ref-storage=$from_format refformat && echo $from_format >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -814,7 +814,7 @@ do test_must_fail git init --ref-storage=$to_format refformat 2>err && test_cmp expect err && echo $from_format >expect && - git -C refformat rev-parse --show-ref-format >actual && + git -C refformat rev-parse --show-ref-storage >actual && test_cmp expect actual ' done
@@ -933,7 +933,7 @@ test_expect_success 'init with includeIf.onbranch condition' ' test_when_finished "rm -rf repo" && git -c includeIf.onbranch:main.path=nonexistent init repo && echo $GIT_DEFAULT_REF_FORMAT >expect && - git -C repo rev-parse --show-ref-format >actual && + git -C repo rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -942,7 +942,7 @@ test_expect_success 'init with includeIf.onbranch condition with existing direct mkdir repo && git -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo && echo $GIT_DEFAULT_REF_FORMAT >expect && - git -C repo rev-parse --show-ref-format >actual && + git -C repo rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -951,7 +951,7 @@ test_expect_success 're-init with includeIf.onbranch condition' ' git init repo && git -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo && echo $GIT_DEFAULT_REF_FORMAT >expect && - git -C repo rev-parse --show-ref-format >actual && + git -C repo rev-parse --show-ref-storage >actual && test_cmp expect actual '
diff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh
index d367b4b787..8588904c3f 100755
--- a/t/t0610-reftable-basics.sh
+++ b/t/t0610-reftable-basics.sh@@ -27,7 +27,7 @@ test_expect_success 'init: creates basic reftable structures' ' test_path_is_dir repo/.git/reftable && test_path_is_file repo/.git/reftable/tables.list && echo reftable >expect && - git -C repo rev-parse --show-ref-format >actual && + git -C repo rev-parse --show-ref-storage >actual && test_cmp expect actual '
@@ -38,7 +38,7 @@ test_expect_success 'init: sha256 object format via environment variable' ' sha256 reftable EOF - git -C repo rev-parse --show-object-format --show-ref-format >actual && + git -C repo rev-parse --show-object-format --show-ref-storage >actual && test_cmp expect actual '
@@ -49,7 +49,7 @@ test_expect_success 'init: sha256 object format via option' ' sha256 reftable EOF - git -C repo rev-parse --show-object-format --show-ref-format >actual && + git -C repo rev-parse --show-object-format --show-ref-storage >actual && test_cmp expect actual '
@@ -156,7 +156,7 @@ test_expect_success 'clone: can clone reftable repository' ' git clone repo cloned && echo reftable >expect && - git -C cloned rev-parse --show-ref-format >actual && + git -C cloned rev-parse --show-ref-storage >actual && test_cmp expect actual && test_path_is_file cloned/file1 '
@@ -171,11 +171,11 @@ test_expect_success 'clone: can clone reffiles into reftable repository' ' git -C reftable rev-parse HEAD >actual && test_cmp expect actual && - git -C reftable rev-parse --show-ref-format >actual && + git -C reftable rev-parse --show-ref-storage >actual && echo reftable >expect && test_cmp expect actual && - git -C reffiles rev-parse --show-ref-format >actual && + git -C reffiles rev-parse --show-ref-storage >actual && echo files >expect && test_cmp expect actual '
@@ -190,11 +190,11 @@ test_expect_success 'clone: can clone reftable into reffiles repository' ' git -C reffiles rev-parse HEAD >actual && test_cmp expect actual && - git -C reftable rev-parse --show-ref-format >actual && + git -C reftable rev-parse --show-ref-storage >actual && echo reftable >expect && test_cmp expect actual && - git -C reffiles rev-parse --show-ref-format >actual && + git -C reffiles rev-parse --show-ref-storage >actual && echo files >expect && test_cmp expect actual '
diff --git a/t/t1460-refs-migrate.sh b/t/t1460-refs-migrate.sh
index 4f2ff725ce..2d73537de6 100755
--- a/t/t1460-refs-migrate.sh
+++ b/t/t1460-refs-migrate.sh@@ -53,7 +53,7 @@ test_migration () { test_cmp expect_logs actual_logs fi && - git -C "$repo" rev-parse --show-ref-format >actual && + git -C "$repo" rev-parse --show-ref-storage >actual && echo "$format" >expect && test_cmp expect actual }
@@ -215,7 +215,7 @@ do test_grep "Finished dry-run migration of refs" output && test_path_is_dir repo/.git/ref_migration.* && echo $from_format >expect && - git -C repo rev-parse --show-ref-format >actual && + git -C repo rev-parse --show-ref-storage >actual && test_cmp expect actual '
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 4174ca40c3..72fe262484 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh@@ -241,19 +241,19 @@ test_expect_success RUST 'rev-parse --show-object-format in repo with compat mod ) ' -test_expect_success 'rev-parse --show-ref-format' ' +test_expect_success 'rev-parse --show-ref-storage' ' test_detect_ref_format >expect && - git rev-parse --show-ref-format >actual && + git rev-parse --show-ref-storage >actual && test_cmp expect actual ' -test_expect_success 'rev-parse --show-ref-format with invalid storage' ' +test_expect_success 'rev-parse --show-ref-storage with invalid storage' ' test_when_finished "rm -rf repo" && git init repo && ( cd repo && git config extensions.refstorage broken && - test_must_fail git rev-parse --show-ref-format 2>err && + test_must_fail git rev-parse --show-ref-storage 2>err && test_grep "error: invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}broken${SQ}" err ) '
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 88f359914f..c0c17cf75a 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh@@ -168,7 +168,7 @@ test_expect_success 'clone with files ref format' ' test_when_finished "rm -rf ref-storage" && git clone --ref-storage=files --mirror src ref-storage && echo files >expect && - git -C ref-storage rev-parse --show-ref-format >actual && + git -C ref-storage rev-parse --show-ref-storage >actual && test_cmp expect actual '
diff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh
index c20d981ef2..4d03b71243 100755
--- a/t/t7424-submodule-mixed-ref-formats.sh
+++ b/t/t7424-submodule-mixed-ref-formats.sh@@ -6,7 +6,7 @@ test_description='submodules handle mixed ref storage formats' test_ref_format () { echo "$2" >expect && - git -C "$1" rev-parse --show-ref-format >actual && + git -C "$1" rev-parse --show-ref-storage >actual && test_cmp expect actual }
--
2.55.0.1007.g17ff1f9808.dirty