git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 05/11] builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage-format"

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 7, 2026, 11:18 UTC
Message-ID
<20260907-b4-pks-unify-ref-storage-format-v2-5-6733c90ca5b0@pks.im>
In-Reply-To
<20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im>

With the same reasoning as for git-init(1), rename "--show-ref-format" to "--show-ref-storage-format" and keep the old name as an alias.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 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..f794ceef22 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-format::
 	Show the reference storage format used for the repository.
 
 
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 43693454d5..ec33c19bdf 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-format")) {
 				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..754a5edc9a 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-format \
 		--short HEAD 2>/dev/null)"
 	rev_parse_exit_code="$?"
 
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 3ce49fd423..846ecc35c3 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)"
+	ref_storage_format="$("$MODERN_GIT" -C "$source" rev-parse --show-ref-storage-format)"
 	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-format="$refformat" --object-format="$objectformat" &&
+		"$MODERN_GIT" init -q --ref-storage-format="$ref_storage_format" --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 df9a2ff2da..b4f19d8077 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-format >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-format >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-format >actual &&
 		test_cmp expect actual
 	'
 
@@ -700,7 +700,7 @@ do
 		test_when_finished "rm -rf refformat" &&
 		git init --ref-storage-format=$format refformat &&
 		echo $format >expect &&
-		git -C refformat rev-parse --show-ref-format >actual &&
+		git -C refformat rev-parse --show-ref-storage-format >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-format >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=$format refformat &&
 		echo $format >expect &&
-		git -C refformat rev-parse --show-ref-format >actual &&
+		git -C refformat rev-parse --show-ref-storage-format >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-format >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-format >actual &&
 		test_cmp expect actual
 	'
 done
@@ -739,7 +739,7 @@ test_expect_success "--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT" '
 	test_when_finished "rm -rf refformat" &&
 	GIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&
 	echo reftable >expect &&
-	git -C refformat rev-parse --show-ref-format >actual &&
+	git -C refformat rev-parse --show-ref-storage-format >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-format >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-format >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-format >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-format >actual &&
 	test_cmp expect actual
 '
 
@@ -794,7 +794,7 @@ do
 		git init --ref-storage-format=$from_format refformat &&
 		git init --ref-storage-format=$from_format refformat &&
 		echo $from_format >expect &&
-		git -C refformat rev-parse --show-ref-format >actual &&
+		git -C refformat rev-parse --show-ref-storage-format >actual &&
 		test_cmp expect actual
 	'
 
@@ -814,7 +814,7 @@ do
 			test_must_fail git init --ref-storage-format=$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-format >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-format >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-format >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-format >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh
index d325f17a14..b6db54430a 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-format >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-format >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-format >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-format >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-format >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-format >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-format >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-format >actual &&
 	echo files >expect &&
 	test_cmp expect actual
 '
diff --git a/t/t1460-refs-migrate.sh b/t/t1460-refs-migrate.sh
index 204dd79b41..ecf6411288 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-format >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-format >actual &&
 			test_cmp expect actual
 		'
 
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 4174ca40c3..30bf8a4d0a 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-format' '
 	test_detect_ref_format >expect &&
-	git rev-parse --show-ref-format >actual &&
+	git rev-parse --show-ref-storage-format >actual &&
 	test_cmp expect actual
 '
 
-test_expect_success 'rev-parse --show-ref-format with invalid storage' '
+test_expect_success 'rev-parse --show-ref-storage-format 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-format 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 202d86bc83..06f6121f82 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-format=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-format >actual &&
 	test_cmp expect actual
 '
 
diff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh
index 2ef85289b3..9707744644 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-format >actual &&
 	test_cmp expect actual
 }
 
-- 
2.55.0.1007.g17ff1f9808.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 13 of 27 in “Fix inconsistent ref storage format terminology”
  1. 00/11 Fix inconsistent ref storage format terminologyPatrick Steinhardt, Sep 7, 2026
  2. 01/11 builtin/init: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 7, 2026
  3. Kaartic SivaraamSep 8, 2026
  4. Patrick SteinhardtSep 9, 2026
  5. Kaartic SivaraamSep 9, 2026
  6. 02/11 builtin/clone: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 7, 2026
  7. Kaartic SivaraamSep 8, 2026
  8. Patrick SteinhardtSep 9, 2026
  9. 03/11 builtin/refs: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 7, 2026
  10. Kaartic SivaraamSep 8, 2026
  11. Patrick SteinhardtSep 9, 2026
  12. 04/11 builtin/submodule: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 7, 2026
  13. 05/11 builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage-format"Patrick Steinhardt, Sep 7, 2026
  14. 06/11 help: rename "default-ref-format" to "default-ref-storage-format"Patrick Steinhardt, Sep 7, 2026
  15. 07/11 refs: expose function to parse reference URIsPatrick Steinhardt, Sep 7, 2026
  16. Kaartic SivaraamSep 8, 2026
  17. Patrick SteinhardtSep 9, 2026
  18. 08/11 setup: refactor how we configure the ref storage formatPatrick Steinhardt, Sep 7, 2026
  19. Kaartic SivaraamSep 9, 2026
  20. Patrick SteinhardtSep 9, 2026
  21. 09/11 setup: rename ref storage format environment variablesPatrick Steinhardt, Sep 7, 2026
  22. Kaartic SivaraamSep 9, 2026
  23. Patrick SteinhardtSep 9, 2026
  24. 10/11 setup: rename "init.defaultRefFormat" to "init.defaultRefStorageFormat"Patrick Steinhardt, Sep 7, 2026
  25. 11/11 setup: allow "git init --ref-storage-format=" to specify a payloadPatrick Steinhardt, Sep 7, 2026
  26. Kaartic SivaraamSep 9, 2026
  27. Patrick SteinhardtSep 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.