{"thread":{"id":"66284","subject":"[PATCH v2 01/11] builtin/init: rename \"--ref-format=\" to \"--ref-storage-format=\"","startedAt":"2026-09-07T11:20:13Z","lastAt":"2026-09-09T09:23:47Z","messageCount":27,"participants":["Patrick Steinhardt","Kaartic Sivaraam"],"isPatch":true,"patchVersion":2,"patchTotal":11},"messages":[{"id":"552125","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260904-b4-pks-unify-ref-storage-format-v1-0-08144e5004ff@pks.im","subject":"[PATCH v2 00/11] Fix inconsistent ref storage format terminology","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:34Z","receivedAt":"2026-09-07T11:20:11Z","isPatch":true,"body":"Hi,\n\nback when we gained support for reftables we of course introduced the\nability to control the reference storage format that is used by newly\ncreated repositories. This infrastructure has grown over time, and\nunfortunately without a lot of consistency:\n\n  - The command line parameter to specify the ref storage format is\n    called \"--ref-format=\", while the corresponding repository extension\n    is called \"refStorage\".\n\n  - In most cases we refer to the \"ref storage format\" in our docs, so\n    calling it \"--ref-format=\" is inconsistent with them.\n\n  - It is possible to override the ref storage format via an environment\n    variable that is called \"GIT_REFERENCE_BACKEND\", which is not even\n    remotely consistent with anything else.\n\n  - There is also an \"object format\", but that format does not control\n    how we store objects but rather whether we use SHA1 or SHA256.\n\nSo in summary, it's a huge mess.\n\nThis problem is about to become even worse though, as we're soon going\nto introduce an object storage extension. This extension is the\nequivalent to the ref storage extension, and of course we also want\nusers to be able to control which object storage format new repositories\nare using. But we cannot properly name that parameter without creating\neven more inconsistencies:\n\n  - \"--object-format=\" would match \"--ref-format=\", but that parameter\n    name is already taken to specify the hash function.\n\n  - \"--object-storage=\" would be a good fit, but be inconsistent with\n    \"--ref-format=\". Asking the user to execute `git init\n    --ref-format=reftable --object-format=sha256 --object-storage=foo`\n    just feels extremely awkward.\n\nSo this patch series aims to clean up this huge mess that we (well, to a\nlarge extent I) have created, by bringing consistency to our command\nline switches, environment variables and config options to all use \"ref\nstorage format\" instead. And that also paves the way for the eventual\n\"object storage format\" switches.\n\nAs a cherry on top, this patch series also extends the\n\"--ref-storage-format=\" switch to allow URIs in the form of\n\"files://foo/bar\" to bring it in line with all the other ways to specify\nthe ref storage format that already allow for URIs.\n\nChanges in v2:\n  - Based on Junio's feedback I've renamed all of this to instead be\n    called \"ref storage format\".\n  - Link to v1: https://patch.msgid.link/20260904-b4-pks-unify-ref-storage-format-v1-0-08144e5004ff@pks.im\n\nThanks!\n\nPatrick\n\n---\nPatrick Steinhardt (11):\n      builtin/init: rename \"--ref-format=\" to \"--ref-storage-format=\"\n      builtin/clone: rename \"--ref-format=\" to \"--ref-storage-format=\"\n      builtin/refs: rename \"--ref-format=\" to \"--ref-storage-format=\"\n      builtin/submodule: rename \"--ref-format=\" to \"--ref-storage-format=\"\n      builtin/rev-parse: rename \"--show-ref-format\" to \"--show-ref-storage-format\"\n      help: rename \"default-ref-format\" to \"default-ref-storage-format\"\n      refs: expose function to parse reference URIs\n      setup: refactor how we configure the ref storage format\n      setup: rename ref storage format environment variables\n      setup: rename \"init.defaultRefFormat\" to \"init.defaultRefStorageFormat\"\n      setup: allow \"git init --ref-storage-format=\" to specify a payload\n\n Documentation/BreakingChanges.adoc     |   2 +-\n Documentation/config/feature.adoc      |   2 +-\n Documentation/config/init.adoc         |   6 +-\n Documentation/git-clone.adoc           |   2 +-\n Documentation/git-init.adoc            |   9 +-\n Documentation/git-refs.adoc            |   6 +-\n Documentation/git-rev-parse.adoc       |   2 +-\n Documentation/git-submodule.adoc       |   8 +-\n Documentation/git.adoc                 |  14 +--\n Documentation/ref-storage-format.adoc  |   8 +-\n builtin/clone.c                        |  18 ++--\n builtin/fetch.c                        |   2 +-\n builtin/init-db.c                      |  21 ++---\n builtin/refs.c                         |  11 ++-\n builtin/rev-parse.c                    |   2 +-\n builtin/submodule--helper.c            |  24 +++--\n contrib/completion/git-prompt.sh       |   2 +-\n environment.h                          |   1 +\n git-submodule.sh                       |  20 ++--\n help.c                                 |   2 +-\n refs.c                                 |  23 +++++\n refs.h                                 |   4 +\n setup.c                                | 164 ++++++++++++++++++---------------\n setup.h                                |   2 +-\n t/perf/p1401-ref-store-tombstones.sh   |   4 +-\n t/perf/perf-lib.sh                     |   4 +-\n t/t0001-init.sh                        | 126 +++++++++++++------------\n t/t0610-reftable-basics.sh             |  34 +++----\n t/t0611-reftable-httpd.sh              |   2 +-\n t/t1400-update-ref.sh                  |   2 +-\n t/t1419-exclude-refs.sh                |  16 ++--\n t/t1423-ref-backend.sh                 |  62 +++++++++----\n t/t1460-refs-migrate.sh                |  54 +++++------\n t/t1500-rev-parse.sh                   |   8 +-\n t/t1900-repo-info.sh                   |   6 +-\n t/t5510-fetch.sh                       |  14 +--\n t/t5601-clone.sh                       |   6 +-\n t/t7424-submodule-mixed-ref-formats.sh |  30 +++---\n t/test-lib.sh                          |   8 +-\n 39 files changed, 413 insertions(+), 318 deletions(-)\n\nRange-diff versus v1:\n\n 1:  0b3491b5ff !  1:  6863d9ef8e builtin/init: rename \"--ref-format=\" to \"--ref-storage=\"\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    builtin/init: rename \"--ref-format=\" to \"--ref-storage=\"\n    +    builtin/init: rename \"--ref-format=\" to \"--ref-storage-format=\"\n     \n         Back when we gained support for reftables we of course introduced the\n         ability to control the reference storage format that is used by newly\n    @@ Commit message\n             --object-storage=` just feels extremely awkward.\n     \n         Instead, this and subsequent patches will fix the mess by consistently\n    -    referring to the ref storage format as \"ref storage\" throughout all\n    -    options, environment variables and config settings. This new name much\n    -    more closely indicates that it is about how we store data and finally\n    -    brings consistency into this area. We will keep the old names working of\n    -    course for the sake of backwards compatibility.\n    +    referring to the ref storage format as such throughout all options,\n    +    environment variables and config settings. This new name much more\n    +    closely indicates that it is about how we store data and finally brings\n    +    consistency into this area. We will keep the old names working of course\n    +    for the sake of backwards compatibility.\n     \n         Start with git-init(1).\n     \n    @@ Documentation/config/init.adoc: endif::[]\n      `init.defaultRefFormat`::\n      \tAllows overriding the default ref storage format for new repositories.\n     -\tSee `--ref-format=` in linkgit:git-init[1]. Both the command line\n    -+\tSee `--ref-storage=` in linkgit:git-init[1]. Both the command line\n    ++\tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n      \toption and the `GIT_DEFAULT_REF_FORMAT` environment variable take\n      \tprecedence over this config.\n      \n    @@ Documentation/git-init.adoc: SYNOPSIS\n      git init [-q | --quiet] [--bare] [--template=<template-directory>]\n      \t [--separate-git-dir <git-dir>] [--object-format=<format>]\n     -\t [--ref-format=<format>]\n    -+\t [--ref-storage=<format>]\n    ++\t [--ref-storage-format=<format>]\n      \t [-b <branch-name> | --initial-branch=<branch-name>]\n      \t [--shared[=<permissions>]] [<directory>]\n      \n    @@ Documentation/git-init.adoc: values are `sha1` and (if enabled) `sha256`.  `sha1\n      include::object-format-disclaimer.adoc[]\n      \n     -`--ref-format=<format>`::\n    -+`--ref-storage=<format>`::\n    ++`--ref-storage-format=<format>`::\n      Specify the given ref storage _<format>_ for the repository. The valid values are:\n      +\n      include::ref-storage-format.adoc[]\n    @@ Documentation/git.adoc: double-quotes and respecting backslash escapes. E.g., th\n      \tIf this variable is set, the default reference backend format for new\n      \trepositories will be set to this value. The default is \"files\".\n     -\tSee `--ref-format` in linkgit:git-init[1].\n    -+\tSee `--ref-storage` in linkgit:git-init[1].\n    ++\tSee `--ref-storage-format` in linkgit:git-init[1].\n      \n      `GIT_REFERENCE_BACKEND`::\n          Specify which reference backend to be used along with its URI.\n    @@ builtin/init-db.c: static int shared_callback(const struct option *opt, const ch\n      \tN_(\"git init [-q | --quiet] [--bare] [--template=<template-directory>]\\n\"\n      \t   \"         [--separate-git-dir <git-dir>] [--object-format=<format>]\\n\"\n     -\t   \"         [--ref-format=<format>]\\n\"\n    -+\t   \"         [--ref-storage=<format>]\\n\"\n    ++\t   \"         [--ref-storage-format=<format>]\\n\"\n      \t   \"         [-b <branch-name> | --initial-branch=<branch-name>]\\n\"\n      \t   \"         [--shared[=<permissions>]] [<directory>]\"),\n      \tNULL\n    @@ builtin/init-db.c: int cmd_init_db(int argc,\n      \tint bare = startup_info->force_bare_repository ? 1 : -1;\n      \tconst char *object_format = NULL;\n     -\tconst char *ref_format = NULL;\n    -+\tconst char *ref_storage = NULL;\n    ++\tconst char *ref_storage_format_str = NULL;\n      \tconst char *initial_branch = NULL;\n      \tint hash_algo = GIT_HASH_UNKNOWN;\n      \tenum ref_storage_format ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;\n    @@ builtin/init-db.c: int cmd_init_db(int argc,\n      \t\t\t   N_(\"specify the hash algorithm to use\")),\n     -\t\tOPT_STRING(0, \"ref-format\", &ref_format, N_(\"format\"),\n     -\t\t\t   N_(\"specify the reference format to use\")),\n    -+\t\tOPT_STRING(0, \"ref-storage\", &ref_storage, N_(\"format\"),\n    ++\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n     +\t\t\t   N_(\"specify the reference storage format to use\")),\n    -+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage, N_(\"format\"),\n    ++\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n     +\t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n      \t\tOPT_END()\n      \t};\n    @@ builtin/init-db.c: int cmd_init_db(int argc,\n      \n     -\tif (ref_format) {\n     -\t\tref_storage_format = ref_storage_format_by_name(ref_format);\n    -+\tif (ref_storage) {\n    -+\t\tref_storage_format = ref_storage_format_by_name(ref_storage);\n    ++\tif (ref_storage_format_str) {\n    ++\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n      \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n     -\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_format);\n    -+\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage);\n    ++\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n      \t}\n      \n      \tif (init_shared_repository != -1)\n    @@ t/perf/p1401-ref-store-tombstones.sh: test_description=\"Tests performance of ref\n      \n      test_expect_success \"setup\" '\n     -\tgit init --ref-format=reftable repo &&\n    -+\tgit init --ref-storage=reftable repo &&\n    ++\tgit init --ref-storage-format=reftable repo &&\n      \tblob=$(echo foo | git -C repo hash-object -w --stdin) &&\n      \tfor i in $(test_seq 8000)\n      \tdo\n    @@ t/perf/p1401-ref-store-tombstones.sh: test_perf \"recreate refs after mass delete\n      \n      test_expect_success \"setup asymmetric\" '\n     -\tgit init --ref-format=reftable repo2 &&\n    -+\tgit init --ref-storage=reftable repo2 &&\n    ++\tgit init --ref-storage-format=reftable repo2 &&\n      \tblob=$(echo foo | git -C repo2 hash-object -w --stdin) &&\n      \tfor i in $(test_seq 8000)\n      \tdo\n    @@ t/perf/perf-lib.sh: test_perf_create_repo_from () {\n      \t(\n      \t\tcd \"$repo\" &&\n     -\t\t\"$MODERN_GIT\" init -q --ref-format=\"$refformat\" --object-format=\"$objectformat\" &&\n    -+\t\t\"$MODERN_GIT\" init -q --ref-storage=\"$refformat\" --object-format=\"$objectformat\" &&\n    ++\t\t\"$MODERN_GIT\" init -q --ref-storage-format=\"$refformat\" --object-format=\"$objectformat\" &&\n      \t\ttest_perf_do_repo_symlink_config_ &&\n      \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null &&\n      \t\tif test -f .git/index.lock\n    @@ t/t0001-init.sh: do\n      \t'\n      \n     -\ttest_expect_success \"init with --ref-format=$format\" '\n    -+\ttest_expect_success \"init with --ref-storage=$format\" '\n    ++\ttest_expect_success \"init with --ref-storage-format=$format\" '\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n     -\t\tgit init --ref-format=$format refformat &&\n    -+\t\tgit init --ref-storage=$format refformat &&\n    ++\t\tgit init --ref-storage-format=$format refformat &&\n      \t\techo $format >expect &&\n      \t\tgit -C refformat rev-parse --show-ref-format >actual &&\n      \t\ttest_cmp expect actual\n    @@ t/t0001-init.sh: do\n      \t'\n      \n     -\ttest_expect_success \"--ref-format=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n    -+\ttest_expect_success \"--ref-storage=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n    ++\ttest_expect_success \"--ref-storage-format=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n     -\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-format=$format refformat &&\n    -+\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage=$format refformat &&\n    ++\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n      \t\techo $format >expect &&\n      \t\tgit -C refformat rev-parse --show-ref-format >actual &&\n      \t\ttest_cmp expect actual\n    @@ t/t0001-init.sh: do\n      done\n      \n     -test_expect_success \"--ref-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n    -+test_expect_success \"--ref-storage= overrides GIT_DEFAULT_REF_FORMAT\" '\n    ++test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n     -\tGIT_DEFAULT_REF_FORMAT=files git init --ref-format=reftable refformat &&\n    -+\tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage=reftable refformat &&\n    ++\tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&\n      \techo reftable >expect &&\n      \tgit -C refformat rev-parse --show-ref-format >actual &&\n      \ttest_cmp expect actual\n    @@ t/t0001-init.sh: for from_format in $backends\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n     -\t\tgit init --ref-format=$from_format refformat &&\n     -\t\tgit init --ref-format=$from_format refformat &&\n    -+\t\tgit init --ref-storage=$from_format refformat &&\n    -+\t\tgit init --ref-storage=$from_format refformat &&\n    ++\t\tgit init --ref-storage-format=$from_format refformat &&\n    ++\t\tgit init --ref-storage-format=$from_format refformat &&\n      \t\techo $from_format >expect &&\n      \t\tgit -C refformat rev-parse --show-ref-format >actual &&\n      \t\ttest_cmp expect actual\n    @@ t/t0001-init.sh: do\n      \t\ttest_expect_success \"re-init with different format fails ($from_format -> $to_format)\" '\n      \t\t\ttest_when_finished \"rm -rf refformat\" &&\n     -\t\t\tgit init --ref-format=$from_format refformat &&\n    -+\t\t\tgit init --ref-storage=$from_format refformat &&\n    ++\t\t\tgit init --ref-storage-format=$from_format refformat &&\n      \t\t\tcat >expect <<-EOF &&\n      \t\t\tfatal: attempt to reinitialize repository with different reference storage format\n      \t\t\tEOF\n     -\t\t\ttest_must_fail git init --ref-format=$to_format refformat 2>err &&\n    -+\t\t\ttest_must_fail git init --ref-storage=$to_format refformat 2>err &&\n    ++\t\t\ttest_must_fail git init --ref-storage-format=$to_format refformat 2>err &&\n      \t\t\ttest_cmp expect err &&\n      \t\t\techo $from_format >expect &&\n      \t\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    @@ t/t0001-init.sh: do\n      done\n      \n     -test_expect_success 'init with --ref-format=garbage' '\n    -+test_expect_success 'init with --ref-storage=garbage' '\n    ++test_expect_success 'init with --ref-storage-format=garbage' '\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \tcat >expect <<-EOF &&\n      \tfatal: unknown ref storage format ${SQ}garbage${SQ}\n      \tEOF\n     -\ttest_must_fail git init --ref-format=garbage refformat 2>err &&\n    -+\ttest_must_fail git init --ref-storage=garbage refformat 2>err &&\n    ++\ttest_must_fail git init --ref-storage-format=garbage refformat 2>err &&\n      \ttest_cmp expect err\n      '\n      \n    @@ t/t0610-reftable-basics.sh: test_expect_success 'init: reinitializing reftable b\n      \n      \tgit -C repo for-each-ref >expect &&\n     -\tgit init --ref-format=reftable repo &&\n    -+\tgit init --ref-storage=reftable repo &&\n    ++\tgit init --ref-storage-format=reftable repo &&\n      \tgit -C repo for-each-ref >actual &&\n      \ttest_cmp expect actual\n      '\n    @@ t/t0610-reftable-basics.sh: test_expect_success 'init: reinitializing reftable b\n      test_expect_success 'init: reinitializing files with reftable backend fails' '\n      \ttest_when_finished \"rm -rf repo\" &&\n     -\tgit init --ref-format=files repo &&\n    -+\tgit init --ref-storage=files repo &&\n    ++\tgit init --ref-storage-format=files repo &&\n      \ttest_commit -C repo file &&\n      \n      \tcp repo/.git/HEAD expect &&\n     -\ttest_must_fail git init --ref-format=reftable repo &&\n    -+\ttest_must_fail git init --ref-storage=reftable repo &&\n    ++\ttest_must_fail git init --ref-storage-format=reftable repo &&\n      \ttest_cmp expect repo/.git/HEAD\n      '\n      \n      test_expect_success 'init: reinitializing reftable with files backend fails' '\n      \ttest_when_finished \"rm -rf repo\" &&\n     -\tgit init --ref-format=reftable repo &&\n    -+\tgit init --ref-storage=reftable repo &&\n    ++\tgit init --ref-storage-format=reftable repo &&\n      \ttest_commit -C repo file &&\n      \n      \tcp repo/.git/HEAD expect &&\n     -\ttest_must_fail git init --ref-format=files repo &&\n    -+\ttest_must_fail git init --ref-storage=files repo &&\n    ++\ttest_must_fail git init --ref-storage-format=files repo &&\n      \ttest_cmp expect repo/.git/HEAD\n      '\n      \n    @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reftable repos\n      test_expect_success 'clone: can clone reffiles into reftable repository' '\n      \ttest_when_finished \"rm -rf reffiles reftable\" &&\n     -\tgit init --ref-format=files reffiles &&\n    -+\tgit init --ref-storage=files reffiles &&\n    ++\tgit init --ref-storage-format=files reffiles &&\n      \ttest_commit -C reffiles A &&\n      \tgit clone --ref-format=reftable ./reffiles reftable &&\n      \n    @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reffiles into\n      test_expect_success 'clone: can clone reftable into reffiles repository' '\n      \ttest_when_finished \"rm -rf reffiles reftable\" &&\n     -\tgit init --ref-format=reftable reftable &&\n    -+\tgit init --ref-storage=reftable reftable &&\n    ++\tgit init --ref-storage-format=reftable reftable &&\n      \ttest_commit -C reftable A &&\n      \tgit clone --ref-format=files ./reftable reffiles &&\n      \n    @@ t/t0611-reftable-httpd.sh: start_httpd\n      \n      test_expect_success 'serving ls-remote' '\n     -\tgit init --ref-format=reftable -b main \"$REPO\" &&\n    -+\tgit init --ref-storage=reftable -b main \"$REPO\" &&\n    ++\tgit init --ref-storage-format=reftable -b main \"$REPO\" &&\n      \tcd \"$REPO\" &&\n      \ttest_commit m1 &&\n      \t>.git/git-daemon-export-ok &&\n    @@ t/t1400-update-ref.sh: do\n      \n      \ttest_expect_success CASE_INSENSITIVE_FS \"stdin $type batch-updates existing reference\" '\n     -\t\tgit init --ref-format=reftable repo &&\n    -+\t\tgit init --ref-storage=reftable repo &&\n    ++\t\tgit init --ref-storage-format=reftable repo &&\n      \t\ttest_when_finished \"rm -fr repo\" &&\n      \t\t(\n      \t\t\tcd repo &&\n    @@ t/t1423-ref-backend.sh: do\n      \t\ttest_expect_success \"$method: read from $to_format backend, $dir dir\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\t(\n      \t\t\t\tcd repo &&\n      \t\t\t\ttest_commit 1 &&\n    @@ t/t1423-ref-backend.sh: do\n      \t\ttest_expect_success \"$method: write to $to_format backend, $dir dir\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\t(\n      \t\t\t\tcd repo &&\n      \t\t\t\ttest_commit 1 &&\n    @@ t/t1423-ref-backend.sh: do\n      \t\ttest_expect_success \"$method: with worktree and $to_format backend, $dir dir\" '\n      \t\t\ttest_when_finished \"rm -rf repo wt\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\t(\n      \t\t\t\tcd repo &&\n      \t\t\t\ttest_commit 1 &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format: migration to same format fails\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_must_fail git -C repo refs migrate \\\n      \t\t\t\t--ref-format=$from_format 2>err &&\n      \t\t\tcat >expect <<-EOF &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: migration with worktree fails\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\tgit -C repo worktree add wt &&\n      \t\t\ttest_must_fail git -C repo refs migrate \\\n      \t\t\t\t--ref-format=$to_format 2>err &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: unborn HEAD\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_migration repo \"$to_format\"\n      \t\t'\n      \n      \t\ttest_expect_success \"$from_format -> $to_format: single ref\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\ttest_migration repo \"$to_format\"\n      \t\t'\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: bare repository\" '\n      \t\t\ttest_when_finished \"rm -rf repo repo.git\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tgit clone --ref-format=$from_format --mirror repo repo.git &&\n      \t\t\ttest_migration repo.git \"$to_format\"\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: dangling symref\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tgit -C repo symbolic-ref BROKEN_HEAD refs/heads/nonexistent &&\n      \t\t\ttest_migration repo \"$to_format\" &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: broken ref\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\ttest-tool -C repo ref-store main update-ref \"\" refs/heads/broken \\\n      \t\t\t\t\"$(test_oid 001)\" \"$ZERO_OID\" REF_SKIP_CREATE_REFLOG,REF_SKIP_OID_VERIFICATION &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: pseudo-refs\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tgit -C repo update-ref FOO_HEAD HEAD &&\n      \t\t\ttest_migration repo \"$to_format\"\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: special refs are left alone\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tgit -C repo rev-parse HEAD >repo/.git/MERGE_HEAD &&\n      \t\t\tgit -C repo rev-parse MERGE_HEAD &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: a bunch of refs\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tcat >input <<-EOF &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: dry-run migration does not modify repository\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tgit -C repo refs migrate --dry-run \\\n      \t\t\t\t--ref-format=$to_format >output &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: reflogs of symrefs with target deleted\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tgit -C repo branch branch-1 HEAD &&\n      \t\t\tgit -C repo symbolic-ref refs/heads/symref refs/heads/branch-1 &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: reflogs order is retained\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit --date \"100005000 +0700\" --no-tag -C repo initial &&\n      \t\t\ttest_commit --date \"100003000 +0700\" --no-tag -C repo second &&\n      \t\t\ttest_migration repo \"$to_format\"\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: stash is retained\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\t(\n      \t\t\t\tcd repo &&\n      \t\t\t\ttest_commit initial A &&\n    @@ t/t1460-refs-migrate.sh: do\n      \t\ttest_expect_success \"$from_format -> $to_format: skip reflog with --skip-reflog\" '\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n     -\t\t\tgit init --ref-format=$from_format repo &&\n    -+\t\t\tgit init --ref-storage=$from_format repo &&\n    ++\t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\t# we see that the repository contains reflogs.\n      \t\t\tgit -C repo reflog --all >reflogs &&\n    @@ t/t1460-refs-migrate.sh: done\n      test_expect_success 'multiple reftable blocks with multiple entries' '\n      \ttest_when_finished \"rm -rf repo\" &&\n     -\tgit init --ref-format=files repo &&\n    -+\tgit init --ref-storage=files repo &&\n    ++\tgit init --ref-storage-format=files repo &&\n      \ttest_commit -C repo first &&\n      \ttest_seq -f \"create refs/heads/ref-%d HEAD\" 5000 |\n      \tgit -C repo update-ref --stdin &&\n    @@ t/t1460-refs-migrate.sh: test_expect_success 'multiple reftable blocks with mult\n      test_expect_success 'migrating from files format deletes backend files' '\n      \ttest_when_finished \"rm -rf repo\" &&\n     -\tgit init --ref-format=files repo &&\n    -+\tgit init --ref-storage=files repo &&\n    ++\tgit init --ref-storage-format=files repo &&\n      \ttest_commit -C repo first &&\n      \tgit -C repo pack-refs --all &&\n      \ttest_commit -C repo second &&\n    @@ t/t1460-refs-migrate.sh: test_expect_success 'migrating from files format delete\n      test_expect_success 'migrating from reftable format deletes backend files' '\n      \ttest_when_finished \"rm -rf repo\" &&\n     -\tgit init --ref-format=reftable repo &&\n    -+\tgit init --ref-storage=reftable repo &&\n    ++\tgit init --ref-storage-format=reftable repo &&\n      \ttest_commit -C repo first &&\n      \n      \ttest_path_is_dir repo/.git/reftable &&\n    @@ t/t1900-repo-info.sh: test_repo_info () {\n      \n      test_repo_info 'ref format files is retrieved correctly' \\\n     -\t'git init --ref-format=files' 'format-files' 'references.format' 'files'\n    -+\t'git init --ref-storage=files' 'format-files' 'references.format' 'files'\n    ++\t'git init --ref-storage-format=files' 'format-files' 'references.format' 'files'\n      \n      test_repo_info 'ref format reftable is retrieved correctly' \\\n     -\t'git init --ref-format=reftable' 'format-reftable' 'references.format' 'reftable'\n    -+\t'git init --ref-storage=reftable' 'format-reftable' 'references.format' 'reftable'\n    ++\t'git init --ref-storage-format=reftable' 'format-reftable' 'references.format' 'reftable'\n      \n      test_repo_info 'bare repository = false is retrieved correctly' \\\n      \t'git init' 'nonbare' 'layout.bare' 'false'\n    @@ t/t1900-repo-info.sh: test_expect_success 'values returned in order requested' '\n      \tlayout.bare=false\n      \tEOF\n     -\tgit init --ref-format=files ordered &&\n    -+\tgit init --ref-storage=files ordered &&\n    ++\tgit init --ref-storage-format=files ordered &&\n      \tgit -C ordered repo info layout.bare references.format layout.bare >actual &&\n      \ttest_cmp expect actual\n      '\n    @@ t/t5510-fetch.sh: test_expect_success CASE_INSENSITIVE_FS,REFFILES 'existing ref\n      \ttest_when_finished rm -rf base repo &&\n      \t(\n     -\t\tgit init --ref-format=reftable base &&\n    -+\t\tgit init --ref-storage=reftable base &&\n    ++\t\tgit init --ref-storage-format=reftable base &&\n      \t\tcd base &&\n      \t\techo >file update &&\n      \t\tgit add . &&\n    @@ t/t5510-fetch.sh: test_expect_success REFFILES 'existing reference lock in repo'\n      \t\tcd .. &&\n      \n     -\t\tgit init --ref-format=files --bare repo &&\n    -+\t\tgit init --ref-storage=files --bare repo &&\n    ++\t\tgit init --ref-storage-format=files --bare repo &&\n      \t\tcd repo &&\n      \t\tgit remote add origin ../base &&\n      \t\ttouch refs/heads/foo.lock &&\n    @@ t/t5510-fetch.sh: test_expect_success CASE_INSENSITIVE_FS,REFFILES 'D/F conflict\n      \ttest_when_finished rm -rf base repo &&\n      \t(\n     -\t\tgit init --ref-format=reftable base &&\n    -+\t\tgit init --ref-storage=reftable base &&\n    ++\t\tgit init --ref-storage-format=reftable base &&\n      \t\tcd base &&\n      \t\techo >file update &&\n      \t\tgit add . &&\n    @@ t/t5510-fetch.sh: test_expect_success REFFILES 'D/F conflict on case sensitive f\n      \t\tcd .. &&\n      \n     -\t\tgit init --ref-format=files --bare repo &&\n    -+\t\tgit init --ref-storage=files --bare repo &&\n    ++\t\tgit init --ref-storage-format=files --bare repo &&\n      \t\tcd repo &&\n      \t\tgit remote add origin ../base &&\n      \t\tmkdir refs/heads/foo &&\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'add existing reposi\n      \t\tcd parent &&\n      \t\ttest_commit parent &&\n     -\t\tgit init --ref-format=$OTHER_FORMAT submodule &&\n    -+\t\tgit init --ref-storage=$OTHER_FORMAT submodule &&\n    ++\t\tgit init --ref-storage-format=$OTHER_FORMAT submodule &&\n      \t\ttest_commit -C submodule submodule &&\n      \t\tgit submodule add ./submodule\n      \t)\n 2:  fed94ab4c5 !  2:  d5b7ea9c18 builtin/clone: rename \"--ref-format=\" to \"--ref-storage=\"\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    builtin/clone: rename \"--ref-format=\" to \"--ref-storage=\"\n    +    builtin/clone: rename \"--ref-format=\" to \"--ref-storage-format=\"\n     \n         With the same reasoning as for git-init(1), rename \"--ref-format=\" to\n    -    \"--ref-storage=\" and keep the old name as an alias.\n    +    \"--ref-storage-format=\" and keep the old name as an alias.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ Documentation/git-clone.adoc: or `--mirror` is given)\n      \ttree.\n      \n     -`--ref-format=<ref-format>`::\n    -+`--ref-storage=<ref-format>`::\n    ++`--ref-storage-format=<format>`::\n      \n      Specify the given ref storage format for the repository. The valid values are:\n      +\n    @@ builtin/clone.c: int cmd_clone(int argc,\n      \tstruct string_list option_not = STRING_LIST_INIT_NODUP;\n      \tconst char *real_git_dir = NULL;\n     -\tconst char *ref_format = NULL;\n    -+\tconst char *ref_storage = NULL;\n    ++\tconst char *ref_storage_format_str = NULL;\n      \tconst char *option_upload_pack = \"git-upload-pack\";\n      \tint option_progress = -1;\n      \tint option_sparse_checkout = 0;\n    @@ builtin/clone.c: int cmd_clone(int argc,\n      \t\t\t   N_(\"separate git dir from working tree\")),\n     -\t\tOPT_STRING(0, \"ref-format\", &ref_format, N_(\"format\"),\n     -\t\t\t   N_(\"specify the reference format to use\")),\n    -+\t\tOPT_STRING(0, \"ref-storage\", &ref_storage, N_(\"format\"),\n    ++\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n     +\t\t\t   N_(\"specify the reference storage format to use\")),\n    -+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage, N_(\"format\"),\n    ++\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n     +\t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n      \t\tOPT_STRING_LIST('c', \"config\", &option_config, N_(\"key=value\"),\n      \t\t\t\tN_(\"set config inside the new repository\")),\n    @@ builtin/clone.c: int cmd_clone(int argc,\n      \n     -\tif (ref_format) {\n     -\t\tref_storage_format = ref_storage_format_by_name(ref_format);\n    -+\tif (ref_storage) {\n    -+\t\tref_storage_format = ref_storage_format_by_name(ref_storage);\n    ++\tif (ref_storage_format_str) {\n    ++\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n      \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n     -\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_format);\n    -+\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage);\n    ++\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n      \t}\n      \n      \tif (option_mirror) {\n    @@ builtin/clone.c: int cmd_clone(int argc,\n      ## t/t0610-reftable-basics.sh ##\n     @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reffiles into reftable repository' '\n      \ttest_when_finished \"rm -rf reffiles reftable\" &&\n    - \tgit init --ref-storage=files reffiles &&\n    + \tgit init --ref-storage-format=files reffiles &&\n      \ttest_commit -C reffiles A &&\n     -\tgit clone --ref-format=reftable ./reffiles reftable &&\n    -+\tgit clone --ref-storage=reftable ./reffiles reftable &&\n    ++\tgit clone --ref-storage-format=reftable ./reffiles reftable &&\n      \n      \tgit -C reffiles rev-parse HEAD >expect &&\n      \tgit -C reftable rev-parse HEAD >actual &&\n     @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reftable into reffiles repository' '\n      \ttest_when_finished \"rm -rf reffiles reftable\" &&\n    - \tgit init --ref-storage=reftable reftable &&\n    + \tgit init --ref-storage-format=reftable reftable &&\n      \ttest_commit -C reftable A &&\n     -\tgit clone --ref-format=files ./reftable reffiles &&\n    -+\tgit clone --ref-storage=files ./reftable reffiles &&\n    ++\tgit clone --ref-storage-format=files ./reftable reffiles &&\n      \n      \tgit -C reftable rev-parse HEAD >expect &&\n      \tgit -C reffiles rev-parse HEAD >actual &&\n    @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reftable into\n      ## t/t1460-refs-migrate.sh ##\n     @@ t/t1460-refs-migrate.sh: do\n      \t\t\ttest_when_finished \"rm -rf repo repo.git\" &&\n    - \t\t\tgit init --ref-storage=$from_format repo &&\n    + \t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n     -\t\t\tgit clone --ref-format=$from_format --mirror repo repo.git &&\n    -+\t\t\tgit clone --ref-storage=$from_format --mirror repo repo.git &&\n    ++\t\t\tgit clone --ref-storage-format=$from_format --mirror repo repo.git &&\n      \t\t\ttest_migration repo.git \"$to_format\"\n      \t\t'\n      \n    @@ t/t5510-fetch.sh: test_expect_success \"clone and setup child repos\" '\n      \tgit clone . bundle &&\n      \tgit clone . seven &&\n     -\tgit clone --ref-format=reftable . case_sensitive &&\n    -+\tgit clone --ref-storage=reftable . case_sensitive &&\n    ++\tgit clone --ref-storage-format=reftable . case_sensitive &&\n      \t(\n      \t\tcd case_sensitive &&\n      \t\tgit branch branch1 &&\n      \t\tgit branch bRanch1\n      \t) &&\n     -\tgit clone --ref-format=reftable . case_sensitive_fd &&\n    -+\tgit clone --ref-storage=reftable . case_sensitive_fd &&\n    ++\tgit clone --ref-storage-format=reftable . case_sensitive_fd &&\n      \t(\n      \t\tcd case_sensitive_fd &&\n      \t\tgit branch foo/bar &&\n      \t\tgit branch Foo\n      \t) &&\n     -\tgit clone --ref-format=reftable . case_sensitive_df &&\n    -+\tgit clone --ref-storage=reftable . case_sensitive_df &&\n    ++\tgit clone --ref-storage-format=reftable . case_sensitive_df &&\n      \t(\n      \t\tcd case_sensitive_df &&\n      \t\tgit branch Foo/bar &&\n    @@ t/t5601-clone.sh: test_expect_success 'clone --mirror does not repeat tags' '\n      test_expect_success 'clone with files ref format' '\n      \ttest_when_finished \"rm -rf ref-storage\" &&\n     -\tgit clone --ref-format=files --mirror src ref-storage &&\n    -+\tgit clone --ref-storage=files --mirror src ref-storage &&\n    ++\tgit clone --ref-storage-format=files --mirror src ref-storage &&\n      \techo files >expect &&\n      \tgit -C ref-storage rev-parse --show-ref-format >actual &&\n      \ttest_cmp expect actual\n    @@ t/t5601-clone.sh: test_expect_success 'clone with garbage ref format' '\n      \tfatal: unknown ref storage format ${SQ}garbage${SQ}\n      \tEOF\n     -\ttest_must_fail git clone --ref-format=garbage --mirror src ref-storage 2>err &&\n    -+\ttest_must_fail git clone --ref-storage=garbage --mirror src ref-storage 2>err &&\n    ++\ttest_must_fail git clone --ref-storage-format=garbage --mirror src ref-storage 2>err &&\n      \ttest_cmp expect err &&\n      \ttest_path_is_missing ref-storage\n      '\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'recursive clone pro\n     +\t# specified via `--ref-storage`. The option should propagate to cloned\n      \t# submodules.\n     -\tgit clone --ref-format=$OTHER_FORMAT --recurse-submodules \\\n    -+\tgit clone --ref-storage=$OTHER_FORMAT --recurse-submodules \\\n    ++\tgit clone --ref-storage-format=$OTHER_FORMAT --recurse-submodules \\\n      \t\tupstream downstream &&\n      \ttest_ref_format downstream \"$OTHER_FORMAT\" &&\n      \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\"\n 3:  ca59e60c85 !  3:  253a0e1360 builtin/refs: rename \"--ref-format=\" to \"--ref-storage=\"\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    builtin/refs: rename \"--ref-format=\" to \"--ref-storage=\"\n    +    builtin/refs: rename \"--ref-format=\" to \"--ref-storage-format=\"\n     \n         With the same reasoning as for git-init(1), rename \"--ref-format=\" to\n    -    \"--ref-storage=\" and keep the old name as an alias.\n    +    \"--ref-storage-format=\" and keep the old name as an alias.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ Documentation/git-refs.adoc: git-refs - Low-level access to refs\n      --------\n      [synopsis]\n     -git refs migrate --ref-format=<format> [--no-reflog] [--dry-run]\n    -+git refs migrate --ref-storage=<format> [--no-reflog] [--dry-run]\n    ++git refs migrate --ref-storage-format=<format> [--no-reflog] [--dry-run]\n      git refs verify [--strict] [--verbose]\n      git refs list [--count=<count>] [--shell|--perl|--python|--tcl]\n      \t\t   [(--sort=<key>)...] [--format=<format>]\n    @@ Documentation/git-refs.adoc: OPTIONS\n      \n     -`--ref-format=<format>`::\n     -\tThe ref format to migrate the ref store to. Can be one of:\n    -+`--ref-storage=<format>`::\n    ++`--ref-storage-format=<format>`::\n     +\tThe ref storage format to migrate the ref store to. Can be one of:\n      +\n      include::ref-storage-format.adoc[]\n    @@ builtin/fetch.c: static void ref_transaction_rejection_handler(const char *refna\n      \t\t\t\"store all remote references on disk. Or you can alternatively\\n\"\n      \t\t\t\"migrate your repository to use the 'reftable' backend with the\\n\"\n     -\t\t\t\"following command:\\n\\n    git refs migrate --ref-format=reftable\\n\\n\"\n    -+\t\t\t\"following command:\\n\\n    git refs migrate --ref-storage=reftable\\n\\n\"\n    ++\t\t\t\"following command:\\n\\n    git refs migrate --ref-storage-format=reftable\\n\\n\"\n      \t\t\t\"Please keep in mind that not all implementations of Git support this\\n\"\n      \t\t\t\"new format yet. So if you use tools other than Git to access this\\n\"\n      \t\t\t\"repository it may not be an option to migrate to reftables.\\n\"));\n    @@ builtin/refs.c\n      \n      #define REFS_MIGRATE_USAGE \\\n     -\tN_(\"git refs migrate --ref-format=<format> [--no-reflog] [--dry-run]\")\n    -+\tN_(\"git refs migrate --ref-storage=<format> [--no-reflog] [--dry-run]\")\n    ++\tN_(\"git refs migrate --ref-storage-format=<format> [--no-reflog] [--dry-run]\")\n      \n      #define REFS_VERIFY_USAGE \\\n      \tN_(\"git refs verify [--strict] [--verbose]\")\n    @@ builtin/refs.c: static int cmd_refs_migrate(int argc, const char **argv, const c\n      \tstruct option options[] = {\n     -\t\tOPT_STRING_F(0, \"ref-format\", &format_str, N_(\"format\"),\n     -\t\t\tN_(\"specify the reference format to convert to\"),\n    -+\t\tOPT_STRING_F(0, \"ref-storage\", &format_str, N_(\"format\"),\n    ++\t\tOPT_STRING_F(0, \"ref-storage-format\", &format_str, N_(\"format\"),\n     +\t\t\tN_(\"specify the reference storage format to convert to\"),\n      \t\t\tPARSE_OPT_NONEG),\n     +\t\tOPT_STRING_F(0, \"ref-format\", &format_str, N_(\"format\"),\n    @@ builtin/refs.c: static int cmd_refs_migrate(int argc, const char **argv, const c\n      \t\tusage(_(\"too many arguments\"));\n      \tif (!format_str)\n     -\t\tusage(_(\"missing --ref-format=<format>\"));\n    -+\t\tusage(_(\"missing --ref-storage=<format>\"));\n    ++\t\tusage(_(\"missing --ref-storage-format=<format>\"));\n      \n      \tformat = ref_storage_format_by_name(format_str);\n      \tif (format == REF_STORAGE_FORMAT_UNKNOWN) {\n    @@ t/t1423-ref-backend.sh: do\n      \t\t\t\ttest_commit 3 &&\n      \n     -\t\t\t\tgit refs migrate --dry-run --ref-format=$to_format >out &&\n    -+\t\t\t\tgit refs migrate --dry-run --ref-storage=$to_format >out &&\n    ++\t\t\t\tgit refs migrate --dry-run --ref-storage-format=$to_format >out &&\n      \t\t\t\tBACKEND_PATH=\"$dir/$(sed \"s/.* ${SQ}.git\\/\\(.*\\)${SQ}/\\1/\" out)\" &&\n      \t\t\t\ttest_refs_backend . $from_format \"$to_format://$BACKEND_PATH\" \"$method\"\n      \t\t\t)\n    @@ t/t1423-ref-backend.sh: do\n      \t\t\t\ttest_commit 3 &&\n      \n     -\t\t\t\tgit refs migrate --dry-run --ref-format=$to_format >out &&\n    -+\t\t\t\tgit refs migrate --dry-run --ref-storage=$to_format >out &&\n    ++\t\t\t\tgit refs migrate --dry-run --ref-storage-format=$to_format >out &&\n      \t\t\t\tBACKEND_PATH=\"$dir/$(sed \"s/.* ${SQ}.git\\/\\(.*\\)${SQ}/\\1/\" out)\" &&\n      \n      \t\t\t\ttest_refs_backend . $from_format \"$to_format://$BACKEND_PATH\" \"$method\" &&\n    @@ t/t1423-ref-backend.sh: do\n      \t\t\t\ttest_commit 3 &&\n      \n     -\t\t\t\tgit refs migrate --dry-run --ref-format=$to_format >out &&\n    -+\t\t\t\tgit refs migrate --dry-run --ref-storage=$to_format >out &&\n    ++\t\t\t\tgit refs migrate --dry-run --ref-storage-format=$to_format >out &&\n      \t\t\t\tBACKEND_PATH=\"$dir/$(sed \"s/.* ${SQ}.git\\/\\(.*\\)${SQ}/\\1/\" out)\" &&\n      \n      \t\t\t\trun_with_uri . \"$from_format\" \"$to_format://$BACKEND_PATH\" \\\n    @@ t/t1423-ref-backend.sh: do\n      \t\t\ttest_commit 3 &&\n      \n     -\t\t\tgit refs migrate --ref-format=$to_format &&\n    -+\t\t\tgit refs migrate --ref-storage=$to_format &&\n    ++\t\t\tgit refs migrate --ref-storage-format=$to_format &&\n      \t\t\tgit refs list >out &&\n      \t\t\ttest_grep \"refs/tags/1\"\tout &&\n      \t\t\ttest_grep \"refs/tags/2\"\tout &&\n    @@ t/t1460-refs-migrate.sh: test_migration () {\n      \tfi &&\n      \n     -\tgit -C \"$repo\" refs migrate --ref-format=\"$format\" \"$@\" &&\n    -+\tgit -C \"$repo\" refs migrate --ref-storage=\"$format\" \"$@\" &&\n    ++\tgit -C \"$repo\" refs migrate --ref-storage-format=\"$format\" \"$@\" &&\n      \n      \tgit -C \"$repo\" for-each-ref --include-root-refs \\\n      \t\t--format='%(refname) %(objectname) %(symref)' >actual &&\n    @@ t/t1460-refs-migrate.sh: test_expect_success \"missing ref storage format\" '\n      \ttest_must_fail git -C repo refs migrate 2>err &&\n      \tcat >expect <<-EOF &&\n     -\tusage: missing --ref-format=<format>\n    -+\tusage: missing --ref-storage=<format>\n    ++\tusage: missing --ref-storage-format=<format>\n      \tEOF\n      \ttest_cmp expect err\n      '\n    @@ t/t1460-refs-migrate.sh: test_expect_success \"unknown ref storage format\" '\n      \tgit init repo &&\n      \ttest_must_fail git -C repo refs migrate \\\n     -\t\t--ref-format=unknown 2>err &&\n    -+\t\t--ref-storage=unknown 2>err &&\n    ++\t\t--ref-storage-format=unknown 2>err &&\n      \tcat >expect <<-EOF &&\n      \terror: unknown ref storage format ${SQ}unknown${SQ}\n      \tEOF\n     @@ t/t1460-refs-migrate.sh: do\n      \t\t\ttest_when_finished \"rm -rf repo\" &&\n    - \t\t\tgit init --ref-storage=$from_format repo &&\n    + \t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_must_fail git -C repo refs migrate \\\n     -\t\t\t\t--ref-format=$from_format 2>err &&\n    -+\t\t\t\t--ref-storage=$from_format 2>err &&\n    ++\t\t\t\t--ref-storage-format=$from_format 2>err &&\n      \t\t\tcat >expect <<-EOF &&\n      \t\t\terror: repository already uses ${SQ}$from_format${SQ} format\n      \t\t\tEOF\n     @@ t/t1460-refs-migrate.sh: do\n    - \t\t\tgit init --ref-storage=$from_format repo &&\n    + \t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\tgit -C repo worktree add wt &&\n      \t\t\ttest_must_fail git -C repo refs migrate \\\n     -\t\t\t\t--ref-format=$to_format 2>err &&\n    -+\t\t\t\t--ref-storage=$to_format 2>err &&\n    ++\t\t\t\t--ref-storage-format=$to_format 2>err &&\n      \t\t\tcat >expect <<-EOF &&\n      \t\t\terror: migrating repositories with worktrees is not supported yet\n      \t\t\tEOF\n     @@ t/t1460-refs-migrate.sh: do\n    - \t\t\tgit init --ref-storage=$from_format repo &&\n    + \t\t\tgit init --ref-storage-format=$from_format repo &&\n      \t\t\ttest_commit -C repo initial &&\n      \t\t\tgit -C repo refs migrate --dry-run \\\n     -\t\t\t\t--ref-format=$to_format >output &&\n    -+\t\t\t\t--ref-storage=$to_format >output &&\n    ++\t\t\t\t--ref-storage-format=$to_format >output &&\n      \t\t\ttest_grep \"Finished dry-run migration of refs\" output &&\n      \t\t\ttest_path_is_dir repo/.git/ref_migration.* &&\n      \t\t\techo $from_format >expect &&\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'status with mixed s\n      \tgit -C main submodule add \"file://$(pwd)/submodule\" &&\n      \tgit -C main commit -m \"add submodule\" &&\n     -\tgit -C main/submodule refs migrate --ref-format=$OTHER_FORMAT &&\n    -+\tgit -C main/submodule refs migrate --ref-storage=$OTHER_FORMAT &&\n    ++\tgit -C main/submodule refs migrate --ref-storage-format=$OTHER_FORMAT &&\n      \n      \t# The main repository should use the default ref format now, whereas\n      \t# the submodule should use the other format.\n 4:  1fd412e727 !  4:  00a5bf641d builtin/submodule: rename \"--ref-format=\" to \"--ref-storage=\"\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    builtin/submodule: rename \"--ref-format=\" to \"--ref-storage=\"\n    +    builtin/submodule: rename \"--ref-format=\" to \"--ref-storage-format=\"\n     \n         With the same reasoning as for git-init(1), rename \"--ref-format=\" to\n    -    \"--ref-storage=\" and keep the old name as an alias.\n    +    \"--ref-storage-format=\" and keep the old name as an alias.\n     \n         Note that this commit is a bit more complex compared to the others as we\n         also need to adapt the submodule helper for consistency. But overall,\n    @@ Documentation/git-submodule.adoc: COMMANDS\n      subcommands are available to perform operations on the submodules.\n      \n     -`add [-b <branch>] [-f | --force] [--name <name>] [--reference <repository>] [--ref-format <format>] [--depth <depth>] [--] <repository> [<path>]`::\n    -+`add [-b <branch>] [-f | --force] [--name <name>] [--reference <repository>] [--ref-storage <format>] [--depth <depth>] [--] <repository> [<path>]`::\n    ++`add [-b <branch>] [-f | --force] [--name <name>] [--reference <repository>] [--ref-storage-format <format>] [--depth <depth>] [--] <repository> [<path>]`::\n      \tAdd the given repository as a submodule at the given path\n      \tto the changeset to be committed next to the current\n      \tproject: the current project is termed the \"superproject\".\n    @@ Documentation/git-submodule.adoc: location, and only the superproject's URL need\n      URL in `.gitmodules`.\n      +\n     -If `--ref-format <format>`  is specified, the ref storage format of newly\n    -+If `--ref-storage <format>`  is specified, the ref storage format of newly\n    ++If `--ref-storage-format <format>`  is specified, the ref storage format of newly\n      cloned submodules will be set accordingly.\n      \n      `status [--cached] [--recursive] [--] [<path>...]`::\n    @@ Documentation/git-submodule.adoc: If you really want to remove a submodule from\n      options.\n      \n     -`update [--init] [--remote] [-N | --no-fetch] [--[no-]recommend-shallow] [-f | --force] [--checkout | --rebase | --merge] [--reference=<repository>] [--ref-format=<format>] [--depth=<depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--filter=<filter-spec>] [--] [<path>...]`::\n    -+`update [--init] [--remote] [-N | --no-fetch] [--[no-]recommend-shallow] [-f | --force] [--checkout | --rebase | --merge] [--reference=<repository>] [--ref-storage=<format>] [--depth=<depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--filter=<filter-spec>] [--] [<path>...]`::\n    ++`update [--init] [--remote] [-N | --no-fetch] [--[no-]recommend-shallow] [-f | --force] [--checkout | --rebase | --merge] [--reference=<repository>] [--ref-storage-format=<format>] [--depth=<depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--filter=<filter-spec>] [--] [<path>...]`::\n      +\n      --\n      Update the registered submodules to match what the superproject\n    @@ Documentation/git-submodule.adoc: submodule with the `--init` option.\n      registered submodules, and update any nested submodules within.\n      \n     -If `--ref-format <format>`  is specified, the ref storage format of newly\n    -+If `--ref-storage <format>`  is specified, the ref storage format of newly\n    ++If `--ref-storage-format <format>`  is specified, the ref storage format of newly\n      cloned submodules will be set accordingly.\n      \n      If `--filter <filter-spec>` is specified, the given partial clone filter will be\n    @@ builtin/clone.c: static int checkout(int submodule_progress,\n      \n      \t\tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n     -\t\t\tstrvec_pushf(&cmd.args, \"--ref-format=%s\",\n    -+\t\t\tstrvec_pushf(&cmd.args, \"--ref-storage=%s\",\n    ++\t\t\tstrvec_pushf(&cmd.args, \"--ref-storage-format=%s\",\n      \t\t\t\t     ref_storage_format_to_name(ref_storage_format));\n      \n      \t\tif (filter_submodules && filter_options->choice)\n    @@ builtin/submodule--helper.c: static int clone_submodule(const struct module_clon\n      \t\t}\n      \t\tif (clone_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n     -\t\t\tstrvec_pushf(&cp.args, \"--ref-format=%s\",\n    -+\t\t\tstrvec_pushf(&cp.args, \"--ref-storage=%s\",\n    ++\t\t\tstrvec_pushf(&cp.args, \"--ref-storage-format=%s\",\n      \t\t\t\t     ref_storage_format_to_name(clone_data->ref_storage_format));\n      \t\tif (clone_data->dissociate)\n      \t\t\tstrvec_push(&cp.args, \"--dissociate\");\n    @@ builtin/submodule--helper.c: static int module_clone(int argc, const char **argv\n      \t\t\t   N_(\"reference repository\")),\n     -\t\tOPT_STRING(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n     -\t\t\t   N_(\"specify the reference format to use\")),\n    -+\t\tOPT_STRING(0, \"ref-storage\", &ref_storage_format, N_(\"format\"),\n    ++\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format, N_(\"format\"),\n     +\t\t\t   N_(\"specify the reference storage format to use\")),\n     +\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n     +\t\t\t     N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n    @@ builtin/submodule--helper.c: static int prepare_to_clone_next_submodule(const st\n      \t\tstrvec_push(&child->args, \"--require-init\");\n      \tif (suc->update_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n     -\t\tstrvec_pushf(&child->args, \"--ref-format=%s\",\n    -+\t\tstrvec_pushf(&child->args, \"--ref-storage=%s\",\n    ++\t\tstrvec_pushf(&child->args, \"--ref-storage-format=%s\",\n      \t\t\t     ref_storage_format_to_name(suc->update_data->ref_storage_format));\n      \tstrvec_pushl(&child->args, \"--path\", sub->path, NULL);\n      \tstrvec_pushl(&child->args, \"--name\", sub->name, NULL);\n    @@ builtin/submodule--helper.c: static void update_data_to_args(const struct update\n      \t}\n      \tif (update_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n     -\t\tstrvec_pushf(args, \"--ref-format=%s\",\n    -+\t\tstrvec_pushf(args, \"--ref-storage=%s\",\n    ++\t\tstrvec_pushf(args, \"--ref-storage-format=%s\",\n      \t\t\t     ref_storage_format_to_name(update_data->ref_storage_format));\n      \tif (update_data->filter_options && update_data->filter_options->choice)\n      \t\tstrvec_pushf(args, \"--filter=%s\",\n    @@ builtin/submodule--helper.c: static int module_update(int argc, const char **arg\n      \t\t\t   N_(\"reference repository\")),\n     -\t\tOPT_STRING(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n     -\t\t\t   N_(\"specify the reference format to use\")),\n    -+\t\tOPT_STRING(0, \"ref-storage\", &ref_storage_format, N_(\"format\"),\n    ++\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format, N_(\"format\"),\n     +\t\t\t   N_(\"specify the reference storage format to use\")),\n     +\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n     +\t\t\t     N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n    @@ builtin/submodule--helper.c: static int module_add(int argc, const char **argv,\n      \t\t\t   N_(\"reference repository\")),\n     -\t\tOPT_STRING(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n     -\t\t\t   N_(\"specify the reference format to use\")),\n    -+\t\tOPT_STRING(0, \"ref-storage\", &ref_storage_format, N_(\"format\"),\n    ++\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format, N_(\"format\"),\n     +\t\t\t   N_(\"specify the reference storage format to use\")),\n     +\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n     +\t\t\t     N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n    @@ git-submodule.sh: cmd_add()\n      \t\t\treference=\"$1\"\n      \t\t\t;;\n     -\t\t--ref-format)\n    -+\t\t--ref-format|--ref-storage)\n    ++\t\t--ref-format|--ref-storage-format)\n      \t\t\tcase \"$2\" in '') usage ;; esac\n     -\t\t\tref_format=\"--ref-format=$2\"\n    -+\t\t\tref_storage=\"--ref-storage=$2\"\n    ++\t\t\tref_storage_format=\"--ref-storage-format=$2\"\n      \t\t\tshift\n      \t\t\t;;\n     -\t\t--ref-format=*)\n     -\t\t\tref_format=\"$1\"\n    -+\t\t--ref-format=*|--ref-storage=*)\n    -+\t\t\tref_storage=\"$1\"\n    ++\t\t--ref-format=*|--ref-storage-format=*)\n    ++\t\t\tref_storage_format=\"$1\"\n      \t\t\t;;\n      \t\t--dissociate)\n      \t\t\tdissociate=$1\n    @@ git-submodule.sh: cmd_add()\n      \t\t${branch:+\"$branch\"} \\\n      \t\t${reference:+\"$reference\"} \\\n     -\t\t${ref_format:+\"$ref_format\"} \\\n    -+\t\t${ref_storage:+\"$ref_storage\"} \\\n    ++\t\t${ref_storage_format:+\"$ref_storage_format\"} \\\n      \t\t$dissociate \\\n      \t\t${name:+\"$name\"} \\\n      \t\t${depth:+\"$depth\"} \\\n    @@ git-submodule.sh: cmd_update()\n      \t\t\trebase=$1\n      \t\t\t;;\n     -\t\t--ref-format)\n    -+\t\t--ref-format|--ref-storage)\n    ++\t\t--ref-format|--ref-storage-format)\n      \t\t\tcase \"$2\" in '') usage ;; esac\n     -\t\t\tref_format=\"--ref-format=$2\"\n    -+\t\t\tref_storage=\"--ref-storage=$2\"\n    ++\t\t\tref_storage_format=\"--ref-storage-format=$2\"\n      \t\t\tshift\n      \t\t\t;;\n     -\t\t--ref-format=*)\n     -\t\t\tref_format=\"$1\"\n    -+\t\t--ref-format=*|--ref-storage=*)\n    -+\t\t\tref_storage=\"$1\"\n    ++\t\t--ref-format=*|--ref-storage-format=*)\n    ++\t\t\tref_storage_format=\"$1\"\n      \t\t\t;;\n      \t\t--reference)\n      \t\t\tcase \"$2\" in '') usage ;; esac\n    @@ git-submodule.sh: cmd_update()\n      \t\t$merge \\\n      \t\t$checkout \\\n     -\t\t${ref_format:+\"$ref_format\"} \\\n    -+\t\t${ref_storage:+\"$ref_storage\"} \\\n    ++\t\t${ref_storage_format:+\"$ref_storage_format\"} \\\n      \t\t${reference:+\"$reference\"} \\\n      \t\t$dissociate \\\n      \t\t${depth:+\"$depth\"} \\\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'add submodules with\n      \tgit init upstream &&\n      \ttest_ref_format upstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n     -\tgit -C upstream submodule add --ref-format=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n    -+\tgit -C upstream submodule add --ref-storage=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n    ++\tgit -C upstream submodule add --ref-storage-format=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n      \ttest_ref_format upstream/submodule \"$OTHER_FORMAT\"\n      '\n      \n    +@@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'recursive clone propagates ref storage format' '\n    + \ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_FORMAT\" &&\n    + \n    + \t# The cloned repositories should use the other ref format that we have\n    +-\t# specified via `--ref-storage`. The option should propagate to cloned\n    ++\t# specified via `--ref-storage-format`. The option should propagate to cloned\n    + \t# submodules.\n    + \tgit clone --ref-storage-format=$OTHER_FORMAT --recurse-submodules \\\n    + \t\tupstream downstream &&\n     @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'clone submodules with different ref storage format' '\n      \n      \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n      \ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n     -\tgit -C downstream submodule update --init --ref-format=$OTHER_FORMAT &&\n    -+\tgit -C downstream submodule update --init --ref-storage=$OTHER_FORMAT &&\n    ++\tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n      \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\"\n      '\n      \n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'recursive pull with\n      \t# submodules have different formats.\n      \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n     -\tgit -C downstream submodule update --init --ref-format=$OTHER_FORMAT &&\n    -+\tgit -C downstream submodule update --init --ref-storage=$OTHER_FORMAT &&\n    ++\tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n      \ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n      \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\" &&\n      \n 5:  8abcb5c6df !  5:  25cdb00f8c builtin/rev-parse: rename \"--show-ref-format\" to \"--show-ref-storage\"\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    builtin/rev-parse: rename \"--show-ref-format\" to \"--show-ref-storage\"\n    +    builtin/rev-parse: rename \"--show-ref-format\" to \"--show-ref-storage-format\"\n     \n         With the same reasoning as for git-init(1), rename \"--show-ref-format\"\n    -    to \"--show-ref-storage\" and keep the old name as an alias.\n    +    to \"--show-ref-storage-format\" and keep the old name as an alias.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ Documentation/git-rev-parse.adoc: The following options are unaffected by `--pat\n      \tnot specified, the default is \"storage\".\n      \n     ---show-ref-format::\n    -+--show-ref-storage::\n    ++--show-ref-storage-format::\n      \tShow the reference storage format used for the repository.\n      \n      \n    @@ builtin/rev-parse.c: int cmd_rev_parse(int argc,\n      \t\t\t\tcontinue;\n      \t\t\t}\n     -\t\t\tif (!strcmp(arg, \"--show-ref-format\")) {\n    -+\t\t\tif (!strcmp(arg, \"--show-ref-format\") || !strcmp(arg, \"--show-ref-storage\")) {\n    ++\t\t\tif (!strcmp(arg, \"--show-ref-format\") || !strcmp(arg, \"--show-ref-storage-format\")) {\n      \t\t\t\tputs(ref_storage_format_to_name(the_repository->ref_storage_format));\n      \t\t\t\tcontinue;\n      \t\t\t}\n    @@ contrib/completion/git-prompt.sh: __git_ps1 ()\n      \tlocal repo_info rev_parse_exit_code\n      \trepo_info=\"$(git rev-parse --git-dir --is-inside-git-dir \\\n     -\t\t--is-bare-repository --is-inside-work-tree --show-ref-format \\\n    -+\t\t--is-bare-repository --is-inside-work-tree --show-ref-storage \\\n    ++\t\t--is-bare-repository --is-inside-work-tree --show-ref-storage-format \\\n      \t\t--short HEAD 2>/dev/null)\"\n      \trev_parse_exit_code=\"$?\"\n      \n    @@ t/perf/perf-lib.sh: test_perf_create_repo_from () {\n      \tobjects_dir=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --git-path objects)\"\n      \tcommon_dir=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --git-common-dir)\"\n     -\trefformat=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --show-ref-format)\"\n    -+\trefstorage=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --show-ref-storage)\"\n    ++\tref_storage_format=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --show-ref-storage-format)\"\n      \tobjectformat=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --show-object-format)\"\n      \tmkdir -p \"$repo/.git\"\n      \t(\n    @@ t/perf/perf-lib.sh: test_perf_create_repo_from () {\n      \t) &&\n      \t(\n      \t\tcd \"$repo\" &&\n    --\t\t\"$MODERN_GIT\" init -q --ref-storage=\"$refformat\" --object-format=\"$objectformat\" &&\n    -+\t\t\"$MODERN_GIT\" init -q --ref-storage=\"$refstorage\" --object-format=\"$objectformat\" &&\n    +-\t\t\"$MODERN_GIT\" init -q --ref-storage-format=\"$refformat\" --object-format=\"$objectformat\" &&\n    ++\t\t\"$MODERN_GIT\" init -q --ref-storage-format=\"$ref_storage_format\" --object-format=\"$objectformat\" &&\n      \t\ttest_perf_do_repo_symlink_config_ &&\n      \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null &&\n      \t\tif test -f .git/index.lock\n    @@ t/t0001-init.sh: test_expect_success 'init warns about invalid init.defaultRefFo\n      \ttest_cmp expect err &&\n      \n     -\tgit -C repo rev-parse --show-ref-format >actual &&\n    -+\tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \techo $GIT_DEFAULT_REF_FORMAT >expected &&\n      \ttest_cmp expected actual\n      '\n    @@ t/t0001-init.sh: test_expect_success 'default ref format' '\n      \t) &&\n      \tgit version --build-options | sed -ne \"s/^default-ref-format: //p\" >expect &&\n     -\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0001-init.sh: do\n      \n      \t\techo $format >expect &&\n     -\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      \n     @@ t/t0001-init.sh: do\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n    - \t\tgit init --ref-storage=$format refformat &&\n    + \t\tgit init --ref-storage-format=$format refformat &&\n      \t\techo $format >expect &&\n     -\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      \n    @@ t/t0001-init.sh: do\n      \n      \t\techo $format >expect &&\n     -\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      \n     @@ t/t0001-init.sh: do\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n    - \t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage=$format refformat &&\n    + \t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n      \t\techo $format >expect &&\n     -\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      \n    @@ t/t0001-init.sh: do\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n      \t\tgit init refformat &&\n     -\t\tgit -C refformat rev-parse --show-ref-format >expect &&\n    -+\t\tgit -C refformat rev-parse --show-ref-storage >expect &&\n    ++\t\tgit -C refformat rev-parse --show-ref-storage-format >expect &&\n      \t\tGIT_DEFAULT_REF_FORMAT=$format git init refformat &&\n     -\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      done\n    -@@ t/t0001-init.sh: test_expect_success \"--ref-storage= overrides GIT_DEFAULT_REF_FORMAT\" '\n    +@@ t/t0001-init.sh: test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n    - \tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage=reftable refformat &&\n    + \tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&\n      \techo reftable >expect &&\n     -\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0001-init.sh: test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides init.def\n      \tGIT_DEFAULT_REF_FORMAT=reftable git init refformat &&\n      \techo reftable >expect &&\n     -\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0001-init.sh: test_expect_success \"init with feature.experimental=true\" '\n      \t) &&\n      \techo reftable >expect &&\n     -\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0001-init.sh: test_expect_success \"init.defaultRefFormat overrides feature.ex\n      \t) &&\n      \techo files >expect &&\n     -\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0001-init.sh: test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides feature.\n      \tGIT_DEFAULT_REF_FORMAT=files git init refformat &&\n      \techo files >expect &&\n     -\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n     @@ t/t0001-init.sh: do\n    - \t\tgit init --ref-storage=$from_format refformat &&\n    - \t\tgit init --ref-storage=$from_format refformat &&\n    + \t\tgit init --ref-storage-format=$from_format refformat &&\n    + \t\tgit init --ref-storage-format=$from_format refformat &&\n      \t\techo $from_format >expect &&\n     -\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      \n     @@ t/t0001-init.sh: do\n    - \t\t\ttest_must_fail git init --ref-storage=$to_format refformat 2>err &&\n    + \t\t\ttest_must_fail git init --ref-storage-format=$to_format refformat 2>err &&\n      \t\t\ttest_cmp expect err &&\n      \t\t\techo $from_format >expect &&\n     -\t\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n    -+\t\t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\t\ttest_cmp expect actual\n      \t\t'\n      \tdone\n    @@ t/t0001-init.sh: test_expect_success 'init with includeIf.onbranch condition' '\n      \tgit -c includeIf.onbranch:main.path=nonexistent init repo &&\n      \techo $GIT_DEFAULT_REF_FORMAT >expect &&\n     -\tgit -C repo rev-parse --show-ref-format >actual &&\n    -+\tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0001-init.sh: test_expect_success 'init with includeIf.onbranch condition wit\n      \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n      \techo $GIT_DEFAULT_REF_FORMAT >expect &&\n     -\tgit -C repo rev-parse --show-ref-format >actual &&\n    -+\tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0001-init.sh: test_expect_success 're-init with includeIf.onbranch condition'\n      \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n      \techo $GIT_DEFAULT_REF_FORMAT >expect &&\n     -\tgit -C repo rev-parse --show-ref-format >actual &&\n    -+\tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0610-reftable-basics.sh: test_expect_success 'init: creates basic reftable st\n      \ttest_path_is_file repo/.git/reftable/tables.list &&\n      \techo reftable >expect &&\n     -\tgit -C repo rev-parse --show-ref-format >actual &&\n    -+\tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0610-reftable-basics.sh: test_expect_success 'init: sha256 object format via\n      \treftable\n      \tEOF\n     -\tgit -C repo rev-parse --show-object-format --show-ref-format >actual &&\n    -+\tgit -C repo rev-parse --show-object-format --show-ref-storage >actual &&\n    ++\tgit -C repo rev-parse --show-object-format --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0610-reftable-basics.sh: test_expect_success 'init: sha256 object format via\n      \treftable\n      \tEOF\n     -\tgit -C repo rev-parse --show-object-format --show-ref-format >actual &&\n    -+\tgit -C repo rev-parse --show-object-format --show-ref-storage >actual &&\n    ++\tgit -C repo rev-parse --show-object-format --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reftable repos\n      \tgit clone repo cloned &&\n      \techo reftable >expect &&\n     -\tgit -C cloned rev-parse --show-ref-format >actual &&\n    -+\tgit -C cloned rev-parse --show-ref-storage >actual &&\n    ++\tgit -C cloned rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual &&\n      \ttest_path_is_file cloned/file1\n      '\n    @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reffiles into\n      \ttest_cmp expect actual &&\n      \n     -\tgit -C reftable rev-parse --show-ref-format >actual &&\n    -+\tgit -C reftable rev-parse --show-ref-storage >actual &&\n    ++\tgit -C reftable rev-parse --show-ref-storage-format >actual &&\n      \techo reftable >expect &&\n      \ttest_cmp expect actual &&\n      \n     -\tgit -C reffiles rev-parse --show-ref-format >actual &&\n    -+\tgit -C reffiles rev-parse --show-ref-storage >actual &&\n    ++\tgit -C reffiles rev-parse --show-ref-storage-format >actual &&\n      \techo files >expect &&\n      \ttest_cmp expect actual\n      '\n    @@ t/t0610-reftable-basics.sh: test_expect_success 'clone: can clone reftable into\n      \ttest_cmp expect actual &&\n      \n     -\tgit -C reftable rev-parse --show-ref-format >actual &&\n    -+\tgit -C reftable rev-parse --show-ref-storage >actual &&\n    ++\tgit -C reftable rev-parse --show-ref-storage-format >actual &&\n      \techo reftable >expect &&\n      \ttest_cmp expect actual &&\n      \n     -\tgit -C reffiles rev-parse --show-ref-format >actual &&\n    -+\tgit -C reffiles rev-parse --show-ref-storage >actual &&\n    ++\tgit -C reffiles rev-parse --show-ref-storage-format >actual &&\n      \techo files >expect &&\n      \ttest_cmp expect actual\n      '\n    @@ t/t1460-refs-migrate.sh: test_migration () {\n      \tfi &&\n      \n     -\tgit -C \"$repo\" rev-parse --show-ref-format >actual &&\n    -+\tgit -C \"$repo\" rev-parse --show-ref-storage >actual &&\n    ++\tgit -C \"$repo\" rev-parse --show-ref-storage-format >actual &&\n      \techo \"$format\" >expect &&\n      \ttest_cmp expect actual\n      }\n    @@ t/t1460-refs-migrate.sh: do\n      \t\t\ttest_path_is_dir repo/.git/ref_migration.* &&\n      \t\t\techo $from_format >expect &&\n     -\t\t\tgit -C repo rev-parse --show-ref-format >actual &&\n    -+\t\t\tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\t\t\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \t\t\ttest_cmp expect actual\n      \t\t'\n      \n    @@ t/t1500-rev-parse.sh: test_expect_success RUST 'rev-parse --show-object-format i\n      '\n      \n     -test_expect_success 'rev-parse --show-ref-format' '\n    -+test_expect_success 'rev-parse --show-ref-storage' '\n    ++test_expect_success 'rev-parse --show-ref-storage-format' '\n      \ttest_detect_ref_format >expect &&\n     -\tgit rev-parse --show-ref-format >actual &&\n    -+\tgit rev-parse --show-ref-storage >actual &&\n    ++\tgit rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n     -test_expect_success 'rev-parse --show-ref-format with invalid storage' '\n    -+test_expect_success 'rev-parse --show-ref-storage with invalid storage' '\n    ++test_expect_success 'rev-parse --show-ref-storage-format with invalid storage' '\n      \ttest_when_finished \"rm -rf repo\" &&\n      \tgit init repo &&\n      \t(\n      \t\tcd repo &&\n      \t\tgit config extensions.refstorage broken &&\n     -\t\ttest_must_fail git rev-parse --show-ref-format 2>err &&\n    -+\t\ttest_must_fail git rev-parse --show-ref-storage 2>err &&\n    ++\t\ttest_must_fail git rev-parse --show-ref-storage-format 2>err &&\n      \t\ttest_grep \"error: invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}broken${SQ}\" err\n      \t)\n      '\n    @@ t/t1500-rev-parse.sh: test_expect_success RUST 'rev-parse --show-object-format i\n      ## t/t5601-clone.sh ##\n     @@ t/t5601-clone.sh: test_expect_success 'clone with files ref format' '\n      \ttest_when_finished \"rm -rf ref-storage\" &&\n    - \tgit clone --ref-storage=files --mirror src ref-storage &&\n    + \tgit clone --ref-storage-format=files --mirror src ref-storage &&\n      \techo files >expect &&\n     -\tgit -C ref-storage rev-parse --show-ref-format >actual &&\n    -+\tgit -C ref-storage rev-parse --show-ref-storage >actual &&\n    ++\tgit -C ref-storage rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_description='submodules handle mixe\n      test_ref_format () {\n      \techo \"$2\" >expect &&\n     -\tgit -C \"$1\" rev-parse --show-ref-format >actual &&\n    -+\tgit -C \"$1\" rev-parse --show-ref-storage >actual &&\n    ++\tgit -C \"$1\" rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      }\n      \n 6:  b231264a6c !  6:  08a5f120a7 help: rename \"default-ref-format\" to \"default-ref-storage\"\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    help: rename \"default-ref-format\" to \"default-ref-storage\"\n    +    help: rename \"default-ref-format\" to \"default-ref-storage-format\"\n     \n         When printing information about how specifically Git was built and what\n         defaults it has we also print the default ref storage format used when\n    @@ Commit message\n         \"reftable\" backend.\n     \n         In preceding commits we have adapted \"ref-format\" parameters to be\n    -    called \"ref-storage\" instead to resolve some conceptual mismatches. The\n    -    build information is now the only place where we still refer to it as\n    -    \"default-ref-format\".\n    +    called \"ref-storage-format\" instead to resolve some conceptual\n    +    mismatches. The build information is now the only place where we still\n    +    refer to it as \"default-ref-format\".\n     \n    -    Rename the field to \"default-ref-storage\" instead.\n    +    Rename the field to \"default-ref-storage-format\" instead.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ help.c: void get_version_info(struct strbuf *buf, int show_build_options)\n      #endif\n      \t\tstrbuf_addf(buf, \"SHA-256: %s\\n\", SHA256_BACKEND);\n     -\t\tstrbuf_addf(buf, \"default-ref-format: %s\\n\",\n    -+\t\tstrbuf_addf(buf, \"default-ref-storage: %s\\n\",\n    ++\t\tstrbuf_addf(buf, \"default-ref-storage-format: %s\\n\",\n      \t\t\t    ref_storage_format_to_name(REF_STORAGE_FORMAT_DEFAULT));\n      \t\tstrbuf_addf(buf, \"default-hash: %s\\n\", hash_algos[GIT_HASH_DEFAULT].name);\n      \t}\n    @@ t/t0001-init.sh: test_expect_success 'default ref format' '\n      \t\tgit init refformat\n      \t) &&\n     -\tgit version --build-options | sed -ne \"s/^default-ref-format: //p\" >expect &&\n    -+\tgit version --build-options | sed -ne \"s/^default-ref-storage: //p\" >expect &&\n    - \tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\tgit version --build-options | sed -ne \"s/^default-ref-storage-format: //p\" >expect &&\n    + \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n 7:  afb4c5bf04 =  7:  dca79435f2 refs: expose function to parse reference URIs\n 8:  bfe1888fd4 !  8:  44c87d6aa1 setup: refactor how we configure the ref storage format\n    @@ Commit message\n         and makes the whole logic significantly easier to extend going forward.\n     \n         Note that the new logic intentionally changes the precedence order so\n    -    that \"GIT_REFERENCE_BACKEND\" is now overridden by the \"--ref-storage=\"\n    -    command line option. This matches our usual precedence order, where\n    -    explicit command line arguments override environment variables.\n    +    that \"GIT_REFERENCE_BACKEND\" is now overridden by the\n    +    \"--ref-storage-format=\" command line option. This matches our usual\n    +    precedence order, where explicit command line arguments override\n    +    environment variables.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ setup.c: static void repository_format_configure(struct repository_format *repo_\n     +\t * storage format:\n     +\t *\n     +\t *   1. Explicit override via the command line, like in `git init\n    -+\t *      --ref-storage=`.\n    ++\t *      --ref-storage-format=`.\n     +\t *\n     +\t *   2. Explicit override via the environment with\n     +\t *      GIT_REFERENCE_BACKEND.\n    @@ setup.c: static void repository_format_configure(struct repository_format *repo_\n     +\t} else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) {\n     +\t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n     +\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n    -+\t\t\tdie(_(\"unknown reference storage format specified via %s: '%s'\"),\n    ++\t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n     +\t\t\t    GIT_REFERENCE_BACKEND_ENVIRONMENT, env);\n     +\t} else if (repo_fmt->version >= 0) {\n     +\t\tref_storage_format = repo_fmt->ref_storage_format;\n    @@ setup.c: static void repository_format_configure(struct repository_format *repo_\n     +\t} else if ((env = getenv(\"GIT_DEFAULT_REF_FORMAT\"))) {\n     +\t\tref_storage_format = ref_storage_format_by_name(env);\n     +\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n    -+\t\t\tdie(_(\"unknown reference storage format specified via %s: '%s'\"),\n    ++\t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n     +\t\t\t    \"GIT_DEFAULT_REF_FORMAT\", env);\n     +\t} else if (cfg.ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n     +\t\tref_storage_format = cfg.ref_storage_format;\n    @@ t/t0001-init.sh: test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \tcat >expect <<-EOF &&\n     -\tfatal: unknown ref storage format ${SQ}garbage${SQ}\n    -+\tfatal: unknown reference storage format specified via GIT_DEFAULT_REF_FORMAT: ${SQ}garbage${SQ}\n    ++\tfatal: unknown ref storage format specified via GIT_DEFAULT_REF_FORMAT: ${SQ}garbage${SQ}\n      \tEOF\n      \ttest_must_fail env GIT_DEFAULT_REF_FORMAT=garbage git init refformat 2>err &&\n      \ttest_cmp expect err\n    @@ t/t0001-init.sh: test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage\n      \n     +test_expect_success 'GIT_REFERENCE_BACKEND refuses to reinitialize with different storage format' '\n     +\ttest_when_finished \"rm -rf refbackend\" &&\n    -+\tgit init --ref-storage=files refbackend &&\n    ++\tgit init --ref-storage-format=files refbackend &&\n     +\tcat >expect <<-EOF &&\n     +\tfatal: attempt to reinitialize repository with different reference storage format\n     +\tEOF\n 9:  87f271e84d !  9:  63a0e94d20 setup: rename ref storage format environment variables\n    @@ Commit message\n     \n         With the same reasoning as for git-init(1), rename the environment\n         variables GIT_REFERENCE_BACKEND and GIT_DEFAULT_REF_FORMAT to\n    -    GIT_REF_STORAGE and GIT_DEFAULT_REF_STORAGE, respectively. The old names\n    -    are kept as an alias to retain compatibility.\n    +    GIT_REF_STORAGE_FORMAT and GIT_DEFAULT_REF_STORAGE_FORMAT, respectively.\n    +    The old names are kept as an alias to retain compatibility.\n    +\n    +    While at it, fix indentation for `GIT_REF_STORAGE_FORMAT` docs to use\n    +    tabs instead of spaces.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ Documentation/config/init.adoc\n     @@ Documentation/config/init.adoc: endif::[]\n      `init.defaultRefFormat`::\n      \tAllows overriding the default ref storage format for new repositories.\n    - \tSee `--ref-storage=` in linkgit:git-init[1]. Both the command line\n    + \tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n     -\toption and the `GIT_DEFAULT_REF_FORMAT` environment variable take\n    -+\toption and the `GIT_DEFAULT_REF_STORAGE` environment variable take\n    ++\toption and the `GIT_DEFAULT_REF_STORAGE_FORMAT` environment variable take\n      \tprecedence over this config.\n      \n      init.defaultSubmodulePathConfig::\n    @@ Documentation/git.adoc: double-quotes and respecting backslash escapes. E.g., th\n      \tSee `--object-format` in linkgit:git-init[1].\n      \n     -`GIT_DEFAULT_REF_FORMAT`::\n    -+`GIT_DEFAULT_REF_STORAGE`::\n    - \tIf this variable is set, the default reference backend format for new\n    +-\tIf this variable is set, the default reference backend format for new\n    ++`GIT_DEFAULT_REF_STORAGE_FORMAT`::\n    ++\tIf this variable is set, the default ref storage format for new\n      \trepositories will be set to this value. The default is \"files\".\n    - \tSee `--ref-storage` in linkgit:git-init[1].\n    + \tSee `--ref-storage-format` in linkgit:git-init[1].\n      \n     -`GIT_REFERENCE_BACKEND`::\n     -    Specify which reference backend to be used along with its URI.\n    -+`GIT_REF_STORAGE`::\n    -+    Specify which ref storage to be used along with its URI.\n    -     See `extensions.refStorage` option in linkgit:git-config[1] for more\n    -     details. Overrides the config variable when used.\n    - \n    +-    See `extensions.refStorage` option in linkgit:git-config[1] for more\n    +-    details. Overrides the config variable when used.\n    ++`GIT_REF_STORAGE_FORMAT`::\n    ++\tSpecify which ref storage format to use along with its URI.\n    ++\tSee `extensions.refStorage` option in linkgit:git-config[1] for more\n    ++\tdetails. Overrides the config variable when used.\n    + \n    + Git Commits\n    + ~~~~~~~~~~~\n     \n      ## environment.h ##\n     @@\n      #define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT \"GIT_TEXTDOMAINDIR\"\n      #define GIT_ATTR_SOURCE_ENVIRONMENT \"GIT_ATTR_SOURCE\"\n      #define GIT_REFERENCE_BACKEND_ENVIRONMENT \"GIT_REFERENCE_BACKEND\"\n    -+#define GIT_REF_STORAGE_ENVIRONMENT \"GIT_REF_STORAGE\"\n    ++#define GIT_REF_STORAGE_FORMAT_ENVIRONMENT \"GIT_REF_STORAGE_FORMAT\"\n      \n      /*\n       * Environment variable used to propagate the --no-advice global option to the\n    @@ setup.c: const char *setup_git_directory_gently(struct repository *repo, int *no\n      \t\t\t * for 'extensions.refStorage'.\n      \t\t\t */\n     -\t\t\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n    -+\t\t\tref_backend_uri = getenv(GIT_REF_STORAGE_ENVIRONMENT);\n    ++\t\t\tref_backend_uri = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT);\n     +\t\t\tif (!ref_backend_uri)\n     +\t\t\t\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n      \t\t\tif (ref_backend_uri) {\n    @@ setup.c: const char *setup_git_directory_gently(struct repository *repo, int *no\n      \t\t\t\tdiscovery.format.ref_storage_format =\n     @@ setup.c: static void repository_format_configure(struct repository_format *repo_fmt,\n      \t *   1. Explicit override via the command line, like in `git init\n    - \t *      --ref-storage=`.\n    + \t *      --ref-storage-format=`.\n      \t *\n     -\t *   2. Explicit override via the environment with\n     -\t *      GIT_REFERENCE_BACKEND.\n    -+\t *   2. Explicit override via the environment with \"GIT_REF_STORAGE\" or\n    -+\t *      its deprecated equivalent \"GIT_REFERENCE_BACKEND\".\n    ++\t *   2. Explicit override via the environment with \"GIT_REF_STORAGE_FORMAT\"\n    ++\t *      or its deprecated equivalent \"GIT_REFERENCE_BACKEND\".\n      \t *\n      \t *   3. Existing repository format. All the subsequent sources only\n      \t *      kick in when there is no repository yet.\n      \t *\n      \t *   4. The default ref storage format for new repositories as\n     -\t *      configured via \"GIT_DEFAULT_REF_FORMAT\".\n    -+\t *      configured via \"GIT_DEFAULT_REF_STORAGE\" or its deprecated\n    -+\t *      equivalent \"GIT_DEFAULT_REF_FORMAT\".\n    ++\t *      configured via \"GIT_DEFAULT_REF_STORAGE_FORMAT\" or its\n    ++\t *      deprecated equivalent \"GIT_DEFAULT_REF_FORMAT\".\n      \t *\n      \t *   5. The default ref storage format for new repositories as\n      \t *      configured via \"init.defaultRefFormat\"\n    @@ setup.c: static void repository_format_configure(struct repository_format *repo_\n      \tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n      \t\t/* nothing to do */\n     -\t} else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) {\n    -+\t} else if (((env = getenv(GIT_REF_STORAGE_ENVIRONMENT)) ||\n    ++\t} else if (((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT)) ||\n     +\t\t    (env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT)))) {\n      \t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n      \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n    - \t\t\tdie(_(\"unknown reference storage format specified via %s: '%s'\"),\n    + \t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n     -\t\t\t    GIT_REFERENCE_BACKEND_ENVIRONMENT, env);\n    -+\t\t\t    GIT_REF_STORAGE_ENVIRONMENT, env);\n    ++\t\t\t    GIT_REF_STORAGE_FORMAT_ENVIRONMENT, env);\n      \t} else if (repo_fmt->version >= 0) {\n      \t\tref_storage_format = repo_fmt->ref_storage_format;\n      \t\tref_storage_payload = xstrdup_or_null(repo_fmt->ref_storage_payload);\n     -\t} else if ((env = getenv(\"GIT_DEFAULT_REF_FORMAT\"))) {\n    -+\t} else if (((env = getenv(\"GIT_DEFAULT_REF_STORAGE\")) ||\n    ++\t} else if (((env = getenv(\"GIT_DEFAULT_REF_STORAGE_FORMAT\")) ||\n     +\t\t    (env = getenv(\"GIT_DEFAULT_REF_FORMAT\")))) {\n      \t\tref_storage_format = ref_storage_format_by_name(env);\n      \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n    - \t\t\tdie(_(\"unknown reference storage format specified via %s: '%s'\"),\n    + \t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n     -\t\t\t    \"GIT_DEFAULT_REF_FORMAT\", env);\n    -+\t\t\t    \"GIT_DEFAULT_REF_STORAGE\", env);\n    ++\t\t\t    \"GIT_DEFAULT_REF_STORAGE_FORMAT\", env);\n      \t} else if (cfg.ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n      \t\tref_storage_format = cfg.ref_storage_format;\n      \t} else {\n    @@ t/t0001-init.sh: test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage\n      '\n      \n     -test_expect_success 'init with GIT_DEFAULT_REF_FORMAT=garbage' '\n    -+test_expect_success 'init with GIT_DEFAULT_REF_STORAGE=garbage' '\n    ++test_expect_success 'init with GIT_DEFAULT_REF_STORAGE_FORMAT=garbage' '\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \tcat >expect <<-EOF &&\n    --\tfatal: unknown reference storage format specified via GIT_DEFAULT_REF_FORMAT: ${SQ}garbage${SQ}\n    -+\tfatal: unknown reference storage format specified via GIT_DEFAULT_REF_STORAGE: ${SQ}garbage${SQ}\n    +-\tfatal: unknown ref storage format specified via GIT_DEFAULT_REF_FORMAT: ${SQ}garbage${SQ}\n    ++\tfatal: unknown ref storage format specified via GIT_DEFAULT_REF_STORAGE_FORMAT: ${SQ}garbage${SQ}\n      \tEOF\n     -\ttest_must_fail env GIT_DEFAULT_REF_FORMAT=garbage git init refformat 2>err &&\n    -+\ttest_must_fail env GIT_DEFAULT_REF_STORAGE=garbage git init refformat 2>err &&\n    ++\ttest_must_fail env GIT_DEFAULT_REF_STORAGE_FORMAT=garbage git init refformat 2>err &&\n      \ttest_cmp expect err\n      '\n      \n     -test_expect_success 'GIT_REFERENCE_BACKEND refuses to reinitialize with different storage format' '\n    -+test_expect_success 'GIT_REF_STORAGE refuses to reinitialize with different storage format' '\n    ++test_expect_success 'GIT_REF_STORAGE_FORMAT refuses to reinitialize with different storage format' '\n      \ttest_when_finished \"rm -rf refbackend\" &&\n    - \tgit init --ref-storage=files refbackend &&\n    + \tgit init --ref-storage-format=files refbackend &&\n      \tcat >expect <<-EOF &&\n      \tfatal: attempt to reinitialize repository with different reference storage format\n      \tEOF\n     -\ttest_must_fail env GIT_REFERENCE_BACKEND=reftable git init refbackend 2>err &&\n    -+\ttest_must_fail env GIT_REF_STORAGE=reftable git init refbackend 2>err &&\n    ++\ttest_must_fail env GIT_REF_STORAGE_FORMAT=reftable git init refbackend 2>err &&\n      \ttest_cmp expect err\n      '\n      \n     @@ t/t0001-init.sh: test_expect_success 'init warns about invalid init.defaultRefFormat' '\n      \ttest_cmp expect err &&\n      \n    - \tgit -C repo rev-parse --show-ref-storage >actual &&\n    + \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n     -\techo $GIT_DEFAULT_REF_FORMAT >expected &&\n    -+\techo $GIT_DEFAULT_REF_STORAGE >expected &&\n    ++\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expected &&\n      \ttest_cmp expected actual\n      '\n      \n    @@ t/t0001-init.sh: test_expect_success 'init warns about invalid init.defaultRefFo\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \t(\n     -\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n    -+\t\tsane_unset GIT_DEFAULT_REF_STORAGE &&\n    ++\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n      \t\tgit init refformat\n      \t) &&\n    - \tgit version --build-options | sed -ne \"s/^default-ref-storage: //p\" >expect &&\n    + \tgit version --build-options | sed -ne \"s/^default-ref-storage-format: //p\" >expect &&\n     @@ t/t0001-init.sh: test_expect_success 'default ref format' '\n      backends=\"files reftable\"\n      for format in $backends\n      do\n     -\ttest_expect_success DEFAULT_REPO_FORMAT \"init with GIT_DEFAULT_REF_FORMAT=$format\" '\n    -+\ttest_expect_success DEFAULT_REPO_FORMAT \"init with GIT_DEFAULT_REF_STORAGE=$format\" '\n    ++\ttest_expect_success DEFAULT_REPO_FORMAT \"init with GIT_DEFAULT_REF_STORAGE_FORMAT=$format\" '\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n     -\t\tGIT_DEFAULT_REF_FORMAT=$format git init refformat &&\n    -+\t\tGIT_DEFAULT_REF_STORAGE=$format git init refformat &&\n    ++\t\tGIT_DEFAULT_REF_STORAGE_FORMAT=$format git init refformat &&\n      \n      \t\tif test $format = files\n      \t\tthen\n    @@ t/t0001-init.sh: do\n      \t\ttest_config_global init.defaultRefFormat $format &&\n      \t\t(\n     -\t\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n    -+\t\t\tsane_unset GIT_DEFAULT_REF_STORAGE &&\n    ++\t\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n      \t\t\tgit init refformat\n      \t\t) &&\n      \n    @@ t/t0001-init.sh: do\n      \t\ttest_cmp expect actual\n      \t'\n      \n    --\ttest_expect_success \"--ref-storage=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n    -+\ttest_expect_success \"--ref-storage=$format overrides GIT_DEFAULT_REF_STORAGE\" '\n    +-\ttest_expect_success \"--ref-storage-format=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n    ++\ttest_expect_success \"--ref-storage-format=$format overrides GIT_DEFAULT_REF_STORAGE_FORMAT\" '\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n    --\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage=$format refformat &&\n    -+\t\tGIT_DEFAULT_REF_STORAGE=garbage git init --ref-storage=$format refformat &&\n    +-\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n    ++\t\tGIT_DEFAULT_REF_STORAGE_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n      \t\techo $format >expect &&\n    - \t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    + \t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      \n     -\ttest_expect_success \"reinit repository with GIT_DEFAULT_REF_FORMAT=$format does not change format\" '\n    -+\ttest_expect_success \"reinit repository with GIT_DEFAULT_REF_STORAGE=$format does not change format\" '\n    ++\ttest_expect_success \"reinit repository with GIT_DEFAULT_REF_STORAGE_FORMAT=$format does not change format\" '\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n      \t\tgit init refformat &&\n    - \t\tgit -C refformat rev-parse --show-ref-storage >expect &&\n    + \t\tgit -C refformat rev-parse --show-ref-storage-format >expect &&\n     -\t\tGIT_DEFAULT_REF_FORMAT=$format git init refformat &&\n    -+\t\tGIT_DEFAULT_REF_STORAGE=$format git init refformat &&\n    - \t\tgit -C refformat rev-parse --show-ref-storage >actual &&\n    ++\t\tGIT_DEFAULT_REF_STORAGE_FORMAT=$format git init refformat &&\n    + \t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \t\ttest_cmp expect actual\n      \t'\n      done\n      \n    --test_expect_success \"--ref-storage= overrides GIT_DEFAULT_REF_FORMAT\" '\n    -+test_expect_success \"--ref-storage= overrides GIT_DEFAULT_REF_STORAGE\" '\n    +-test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n    ++test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_STORAGE_FOMAT\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n    --\tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage=reftable refformat &&\n    -+\tGIT_DEFAULT_REF_STORAGE=files git init --ref-storage=reftable refformat &&\n    +-\tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&\n    ++\tGIT_DEFAULT_REF_STORAGE_FORMAT=files git init --ref-storage-format=reftable refformat &&\n      \techo reftable >expect &&\n    - \tgit -C refformat rev-parse --show-ref-storage >actual &&\n    + \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n      \n     -test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides init.defaultRefFormat\" '\n    -+test_expect_success \"GIT_DEFAULT_REF_STORAGE= overrides init.defaultRefFormat\" '\n    ++test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefFormat\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \ttest_config_global init.defaultRefFormat files &&\n      \n     -\tGIT_DEFAULT_REF_FORMAT=reftable git init refformat &&\n    -+\tGIT_DEFAULT_REF_STORAGE=reftable git init refformat &&\n    ++\tGIT_DEFAULT_REF_STORAGE_FORMAT=reftable git init refformat &&\n      \techo reftable >expect &&\n    - \tgit -C refformat rev-parse --show-ref-storage >actual &&\n    + \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n     @@ t/t0001-init.sh: test_expect_success \"init with feature.experimental=true\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \ttest_config_global feature.experimental true &&\n      \t(\n     -\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n    -+\t\tsane_unset GIT_DEFAULT_REF_STORAGE &&\n    ++\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n      \t\tgit init refformat\n      \t) &&\n      \techo reftable >expect &&\n    @@ t/t0001-init.sh: test_expect_success \"init.defaultRefFormat overrides feature.ex\n      \ttest_config_global init.defaultRefFormat files &&\n      \t(\n     -\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n    -+\t\tsane_unset GIT_DEFAULT_REF_STORAGE &&\n    ++\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n      \t\tgit init refformat\n      \t) &&\n      \techo files >expect &&\n    @@ t/t0001-init.sh: test_expect_success \"init.defaultRefFormat overrides feature.ex\n      '\n      \n     -test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides feature.experimental=true\" '\n    -+test_expect_success \"GIT_DEFAULT_REF_STORAGE= overrides feature.experimental=true\" '\n    ++test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides feature.experimental=true\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \ttest_config_global feature.experimental true &&\n     -\tGIT_DEFAULT_REF_FORMAT=files git init refformat &&\n    -+\tGIT_DEFAULT_REF_STORAGE=files git init refformat &&\n    ++\tGIT_DEFAULT_REF_STORAGE_FORMAT=files git init refformat &&\n      \techo files >expect &&\n    - \tgit -C refformat rev-parse --show-ref-storage >actual &&\n    + \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n     @@ t/t0001-init.sh: test_expect_success 'branch -m with the initial branch' '\n      test_expect_success 'init with includeIf.onbranch condition' '\n      \ttest_when_finished \"rm -rf repo\" &&\n      \tgit -c includeIf.onbranch:main.path=nonexistent init repo &&\n     -\techo $GIT_DEFAULT_REF_FORMAT >expect &&\n    -+\techo $GIT_DEFAULT_REF_STORAGE >expect &&\n    - \tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&\n    + \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n     @@ t/t0001-init.sh: test_expect_success 'init with includeIf.onbranch condition with existing direct\n    @@ t/t0001-init.sh: test_expect_success 'init with includeIf.onbranch condition wit\n      \tmkdir repo &&\n      \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n     -\techo $GIT_DEFAULT_REF_FORMAT >expect &&\n    -+\techo $GIT_DEFAULT_REF_STORAGE >expect &&\n    - \tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&\n    + \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n     @@ t/t0001-init.sh: test_expect_success 're-init with includeIf.onbranch condition' '\n    @@ t/t0001-init.sh: test_expect_success 're-init with includeIf.onbranch condition'\n      \tgit init repo &&\n      \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n     -\techo $GIT_DEFAULT_REF_FORMAT >expect &&\n    -+\techo $GIT_DEFAULT_REF_STORAGE >expect &&\n    - \tgit -C repo rev-parse --show-ref-storage >actual &&\n    ++\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&\n    + \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n      \ttest_cmp expect actual\n      '\n     \n    @@ t/t1419-exclude-refs.sh: assert_jumps () {\n      \tlocal trace=\"$2\"\n      \n     -\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n    -+\tcase \"$GIT_DEFAULT_REF_STORAGE\" in\n    ++\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n      \tfiles)\n      \t\tgrep -q \"name:jumps_made value:$nr$\" $trace;;\n      \treftable)\n      \t\tgrep -q \"name:reseeks_made value:$nr$\" $trace;;\n      \t*)\n     -\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n    -+\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_STORAGE\";;\n    ++\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n      \tesac\n      }\n      \n    @@ t/t1419-exclude-refs.sh: test_expect_success 'adjacent, non-overlapping excluded\n      \n      \ttest_cmp expect actual &&\n     -\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n    -+\tcase \"$GIT_DEFAULT_REF_STORAGE\" in\n    ++\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n      \tfiles)\n      \t\tassert_jumps 1 perf;;\n      \treftable)\n      \t\tassert_jumps 2 perf;;\n      \t*)\n     -\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n    -+\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_STORAGE\";;\n    ++\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n      \tesac\n      '\n      \n    @@ t/t1419-exclude-refs.sh: test_expect_success 'several overlapping excluded regio\n      \n      \ttest_cmp expect actual &&\n     -\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n    -+\tcase \"$GIT_DEFAULT_REF_STORAGE\" in\n    ++\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n      \tfiles)\n      \t\tassert_jumps 1 perf;;\n      \treftable)\n      \t\tassert_jumps 3 perf;;\n      \t*)\n     -\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n    -+\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_STORAGE\";;\n    ++\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n      \tesac\n      '\n      \n    @@ t/t1419-exclude-refs.sh: test_expect_success 'unordered excludes' '\n      \n      \ttest_cmp expect actual &&\n     -\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n    -+\tcase \"$GIT_DEFAULT_REF_STORAGE\" in\n    ++\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n      \tfiles)\n      \t\tassert_jumps 1 perf;;\n      \treftable)\n      \t\tassert_jumps 2 perf;;\n      \t*)\n     -\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n    -+\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_STORAGE\";;\n    ++\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n      \tesac\n      '\n      \n    @@ t/t1423-ref-backend.sh: test_description='Test reference backend URIs'\n      #   <cmd> is the git subcommand to be run in the repository.\n      #   <via> if 'config', set the backend via the 'extensions.refStorage' config.\n     -#         if 'env', set the backend via the 'GIT_REFERENCE_BACKEND' env.\n    -+#         if 'env', set the backend via the 'GIT_REF_STORAGE' env.\n    ++#         if 'env', set the backend via the 'GIT_REF_STORAGE_FORMAT' env.\n      run_with_uri () {\n      \trepo=$1 &&\n      \tbackend=$2 &&\n    @@ t/t1423-ref-backend.sh: run_with_uri () {\n      \tif test \"$via\" = \"env\"\n      \tthen\n     -\t\ttest_env GIT_REFERENCE_BACKEND=\"$uri\" git -C \"$repo\" $cmd\n    -+\t\ttest_env GIT_REF_STORAGE=\"$uri\" git -C \"$repo\" $cmd\n    ++\t\ttest_env GIT_REF_STORAGE_FORMAT=\"$uri\" git -C \"$repo\" $cmd\n      \telif test \"$via\" = \"config\"\n      \tthen\n      \t\tgit -C \"$repo\" config set extensions.refStorage \"$uri\" &&\n    @@ t/t1423-ref-backend.sh: run_with_uri () {\n      #   <uri> is the new URI to be set for the ref storage.\n      #   <via> if 'config', set the backend via the 'extensions.refStorage' config.\n     -#         if 'env', set the backend via the 'GIT_REFERENCE_BACKEND' env.\n    -+#         if 'env', set the backend via the 'GIT_REF_STORAGE' env.\n    ++#         if 'env', set the backend via the 'GIT_REF_STORAGE_FORMAT' env.\n      #   <err_msg> (optional) if set, check if 'git-refs(1)' failed with the provided msg.\n      test_refs_backend () {\n      \trepo=$1 &&\n    @@ t/t1423-ref-backend.sh: test_refs_backend () {\n      \t\tif test \"$via\" = \"env\"\n      \t\tthen\n     -\t\t\ttest_env GIT_REFERENCE_BACKEND=\"$uri\" test_must_fail git -C \"$repo\" refs list 2>err\n    -+\t\t\ttest_env GIT_REF_STORAGE=\"$uri\" test_must_fail git -C \"$repo\" refs list 2>err\n    ++\t\t\ttest_env GIT_REF_STORAGE_FORMAT=\"$uri\" test_must_fail git -C \"$repo\" refs list 2>err\n      \t\telif test \"$via\" = \"config\"\n      \t\tthen\n      \t\t\tgit -C \"$repo\" config set extensions.refStorage \"$uri\" &&\n    @@ t/t1423-ref-backend.sh: verify_files_exist () {\n      \n      \t# verify that backend specific files exist.\n     -\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n    -+\tcase \"$GIT_DEFAULT_REF_STORAGE\" in\n    ++\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n      \tfiles)\n      \t\ttest_path_is_dir $refdir/refs/heads &&\n      \t\ttest_path_is_file $refdir/HEAD;;\n    @@ t/t1423-ref-backend.sh: verify_files_exist () {\n      \t\ttest_path_is_file $refdir/reftable/tables.list;;\n      \t*)\n     -\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n    -+\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_STORAGE\";;\n    ++\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n      \tesac\n      }\n      \n    @@ t/t1423-ref-backend.sh: do\n      \t\ttest_when_finished \"rm -rf repo refdir\" &&\n      \t\tmkdir refdir &&\n     -\t\tGIT_REFERENCE_BACKEND=\"${from_format}://$(pwd)/refdir\" git init repo &&\n    -+\t\tGIT_REF_STORAGE=\"${from_format}://$(pwd)/refdir\" git init repo &&\n    ++\t\tGIT_REF_STORAGE_FORMAT=\"${from_format}://$(pwd)/refdir\" git init repo &&\n      \t\t(\n      \t\t\tcd repo &&\n      \n    @@ t/t1423-ref-backend.sh: test_expect_success 'initializing repository with alt re\n      \tmkdir refdir &&\n      \tBACKEND=\"$(test_detect_ref_format)://$(pwd)/refdir\" &&\n     -\tGIT_REFERENCE_BACKEND=$BACKEND git init repo &&\n    -+\tGIT_REF_STORAGE=$BACKEND git init repo &&\n    ++\tGIT_REF_STORAGE_FORMAT=$BACKEND git init repo &&\n      \tverify_files_exist repo/.git refdir &&\n      \t(\n      \t\tcd repo &&\n    @@ t/t1423-ref-backend.sh: test_expect_success 'cloning repository with alt ref dir\n      \n      \tBACKEND=\"$(test_detect_ref_format)://$(pwd)/refdir\" &&\n     -\tGIT_REFERENCE_BACKEND=$BACKEND git clone source repo &&\n    -+\tGIT_REF_STORAGE=$BACKEND git clone source repo &&\n    ++\tGIT_REF_STORAGE_FORMAT=$BACKEND git clone source repo &&\n      \n      \tgit -C repo config get extensions.refstorage >actual &&\n      \techo $BACKEND >expect &&\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_ref_format () {\n      for OTHER_FORMAT in files reftable\n      do\n     -\tif test \"$OTHER_FORMAT\" = \"$GIT_DEFAULT_REF_FORMAT\"\n    -+\tif test \"$OTHER_FORMAT\" = \"$GIT_DEFAULT_REF_STORAGE\"\n    ++\tif test \"$OTHER_FORMAT\" = \"$GIT_DEFAULT_REF_STORAGE_FORMAT\"\n      \tthen\n      \t\tcontinue\n      \tfi\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'add submodules with\n      \ttest_commit -C submodule submodule-initial &&\n      \tgit init upstream &&\n     -\ttest_ref_format upstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n    -+\ttest_ref_format upstream \"$GIT_DEFAULT_REF_STORAGE\" &&\n    - \tgit -C upstream submodule add --ref-storage=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n    ++\ttest_ref_format upstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n    + \tgit -C upstream submodule add --ref-storage-format=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n      \ttest_ref_format upstream/submodule \"$OTHER_FORMAT\"\n      '\n     @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'recursive clone propagates ref storage format' '\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'recursive clone pro\n      \t# ref format.\n     -\ttest_ref_format upstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n     -\ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_FORMAT\" &&\n    -+\ttest_ref_format upstream \"$GIT_DEFAULT_REF_STORAGE\" &&\n    -+\ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_STORAGE\" &&\n    ++\ttest_ref_format upstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n    ++\ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n      \n      \t# The cloned repositories should use the other ref format that we have\n    - \t# specified via `--ref-storage`. The option should propagate to cloned\n    + \t# specified via `--ref-storage-format`. The option should propagate to cloned\n     @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'clone submodules with different ref storage format' '\n      \tgit -C upstream commit -m \"upstream submodule\" &&\n      \n      \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n     -\ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n    -+\ttest_ref_format downstream \"$GIT_DEFAULT_REF_STORAGE\" &&\n    - \tgit -C downstream submodule update --init --ref-storage=$OTHER_FORMAT &&\n    ++\ttest_ref_format downstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n    + \tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n      \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\"\n      '\n     @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'status with mixed submodule ref storages' '\n    @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'status with mixed s\n      \t# The main repository should use the default ref format now, whereas\n      \t# the submodule should use the other format.\n     -\ttest_ref_format main \"$GIT_DEFAULT_REF_FORMAT\" &&\n    -+\ttest_ref_format main \"$GIT_DEFAULT_REF_STORAGE\" &&\n    ++\ttest_ref_format main \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n      \ttest_ref_format main/submodule \"$OTHER_FORMAT\" &&\n      \n      \tcat >expect <<-EOF &&\n     @@ t/t7424-submodule-mixed-ref-formats.sh: test_expect_success 'recursive pull with mixed formats' '\n      \t# submodules have different formats.\n      \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n    - \tgit -C downstream submodule update --init --ref-storage=$OTHER_FORMAT &&\n    + \tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n     -\ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n    -+\ttest_ref_format downstream \"$GIT_DEFAULT_REF_STORAGE\" &&\n    ++\ttest_ref_format downstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n      \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\" &&\n      \n      \t# Update the upstream submodule as well as the owning repository such\n    @@ t/test-lib.sh: export EDITOR\n      export GIT_DEFAULT_HASH\n     -GIT_DEFAULT_REF_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n     -export GIT_DEFAULT_REF_FORMAT\n    -+GIT_DEFAULT_REF_STORAGE=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n    -+export GIT_DEFAULT_REF_STORAGE\n    ++GIT_DEFAULT_REF_STORAGE_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n    ++export GIT_DEFAULT_REF_STORAGE_FORMAT\n      \n      # Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output\n      GIT_TRACE_BARE=1\n    @@ t/test-lib.sh: parisc* | hppa*)\n      esac\n      \n     -case \"$GIT_DEFAULT_REF_FORMAT\" in\n    -+case \"$GIT_DEFAULT_REF_STORAGE\" in\n    ++case \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n      files)\n      \ttest_set_prereq REFFILES;;\n      reftable)\n      \ttest_set_prereq REFTABLE;;\n      *)\n     -\techo 2>&1 \"error: unknown ref format $GIT_DEFAULT_REF_FORMAT\"\n    -+\techo 2>&1 \"error: unknown ref format $GIT_DEFAULT_REF_STORAGE\"\n    ++\techo 2>&1 \"error: unknown ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\"\n      \texit 1\n      \t;;\n      esac\n10:  01ba1710d3 ! 10:  e53d951d57 setup: rename \"init.defaultRefFormat\" to \"init.defaultRefStorage\"\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    setup: rename \"init.defaultRefFormat\" to \"init.defaultRefStorage\"\n    +    setup: rename \"init.defaultRefFormat\" to \"init.defaultRefStorageFormat\"\n     \n         With the same reasoning as for git-init(1), rename the\n    -    \"init.defaultRefFormat\" config option to \"init.defaultRefStorage\" and\n    -    keep the old name as an alias.\n    +    \"init.defaultRefFormat\" config option to \"init.defaultRefStorageFormat\"\n    +    and keep the old name as an alias.\n     \n         Signed-off-by: Patrick Steinhardt <ps@pks.im>\n     \n    @@ Documentation/BreakingChanges.adoc: Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zo\n      +\n      Users that get immediate benefit from the \"reftable\" backend could continue to\n     -opt-in to the \"reftable\" format manually by setting the \"init.defaultRefFormat\"\n    -+opt-in to the \"reftable\" format manually by setting the \"init.defaultRefStorage\"\n    ++opt-in to the \"reftable\" format manually by setting the \"init.defaultRefStorageFormat\"\n      config. But defaults matter, and we think that overall users will have a better\n      experience with less platform-specific quirks when they use the new backend by\n      default.\n    @@ Documentation/config/feature.adoc: reusing objects from multiple packs instead o\n      default name-hash.\n      +\n     -* `init.defaultRefFormat=reftable` causes newly initialized repositories to use\n    -+* `init.defaultRefStorage=reftable` causes newly initialized repositories to use\n    ++* `init.defaultRefStorageFormat=reftable` causes newly initialized repositories to use\n      the reftable format for storing references. This new format solves issues with\n      case-insensitive filesystems, compresses better and performs significantly\n      better with many use cases. Refer to Documentation/technical/reftable.adoc for\n    @@ Documentation/config/init.adoc: endif::[]\n      \tand the `GIT_DEFAULT_HASH` environment variable take precedence over\n      \tthis config.\n     -`init.defaultRefFormat`::\n    -+`init.defaultRefStorage`::\n    ++`init.defaultRefStorageFormat`::\n      \tAllows overriding the default ref storage format for new repositories.\n    - \tSee `--ref-storage=` in linkgit:git-init[1]. Both the command line\n    - \toption and the `GIT_DEFAULT_REF_STORAGE` environment variable take\n    + \tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n    + \toption and the `GIT_DEFAULT_REF_STORAGE_FORMAT` environment variable take\n     \n      ## setup.c ##\n     @@ setup.c: static int read_default_format_config(const char *key, const char *value,\n    @@ setup.c: static int read_default_format_config(const char *key, const char *valu\n      \t}\n      \n     -\tif (!strcmp(key, \"init.defaultrefformat\")) {\n    -+\tif (!strcmp(key, \"init.defaultrefstorage\") ||\n    ++\tif (!strcmp(key, \"init.defaultrefstorageformat\") ||\n     +\t    !strcmp(key, \"init.defaultrefformat\")) {\n      \t\tret = git_config_string(&str, key, value);\n      \t\tif (ret)\n    @@ setup.c: static int read_default_format_config(const char *key, const char *valu\n      \t/*\n      \t * Enable the reftable format when \"features.experimental\" is enabled.\n     -\t * \"init.defaultRefFormat\" takes precedence over this setting.\n    -+\t * \"init.defaultRefStorage\" takes precedence over this setting.\n    ++\t * \"init.defaultRefStorageFormat\" takes precedence over this setting.\n      \t */\n      \tif (!strcmp(key, \"feature.experimental\") &&\n      \t    cfg->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN &&\n     @@ setup.c: static void repository_format_configure(struct repository_format *repo_fmt,\n    - \t *      equivalent \"GIT_DEFAULT_REF_FORMAT\".\n    + \t *      deprecated equivalent \"GIT_DEFAULT_REF_FORMAT\".\n      \t *\n      \t *   5. The default ref storage format for new repositories as\n     -\t *      configured via \"init.defaultRefFormat\"\n    -+\t *      configured via \"init.defaultRefStorage\" or its deprecated\n    ++\t *      configured via \"init.defaultRefStorageFormat\" or its deprecated\n     +\t *      equivalent \"init.defaultRefFormat\".\n      \t *\n      \t *   6. Otherwise, we fall back to the default ref storage format\n      \t *      compiled into Git.\n     \n      ## t/t0001-init.sh ##\n    -@@ t/t0001-init.sh: test_expect_success 'GIT_REF_STORAGE refuses to reinitialize with different stor\n    +@@ t/t0001-init.sh: test_expect_success 'GIT_REF_STORAGE_FORMAT refuses to reinitialize with differe\n      \ttest_cmp expect err\n      '\n      \n     -test_expect_success 'init warns about invalid init.defaultRefFormat' '\n    -+test_expect_success 'init warns about invalid init.defaultRefStorage' '\n    ++test_expect_success 'init warns about invalid init.defaultRefStorageFormat' '\n      \ttest_when_finished \"rm -rf repo\" &&\n     -\ttest_config_global init.defaultRefFormat garbage &&\n    -+\ttest_config_global init.defaultRefStorage garbage &&\n    ++\ttest_config_global init.defaultRefStorageFormat garbage &&\n      \n      \techo \"warning: unknown ref storage format ${SQ}garbage${SQ}\" >expect &&\n      \tgit init repo 2>err &&\n    @@ t/t0001-init.sh: do\n      \t'\n      \n     -\ttest_expect_success \"init with init.defaultRefFormat=$format\" '\n    -+\ttest_expect_success \"init with init.defaultRefStorage=$format\" '\n    ++\ttest_expect_success \"init with init.defaultRefStorageFormat=$format\" '\n      \t\ttest_when_finished \"rm -rf refformat\" &&\n     -\t\ttest_config_global init.defaultRefFormat $format &&\n    -+\t\ttest_config_global init.defaultRefStorage $format &&\n    ++\t\ttest_config_global init.defaultRefStorageFormat $format &&\n      \t\t(\n    - \t\t\tsane_unset GIT_DEFAULT_REF_STORAGE &&\n    + \t\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n      \t\t\tgit init refformat\n    -@@ t/t0001-init.sh: test_expect_success \"--ref-storage= overrides GIT_DEFAULT_REF_STORAGE\" '\n    +@@ t/t0001-init.sh: test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_STORAGE_FOM\n      \ttest_cmp expect actual\n      '\n      \n    --test_expect_success \"GIT_DEFAULT_REF_STORAGE= overrides init.defaultRefFormat\" '\n    -+test_expect_success \"GIT_DEFAULT_REF_STORAGE= overrides init.defaultRefStorage\" '\n    +-test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefFormat\" '\n    ++test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefStorageFormat\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n     -\ttest_config_global init.defaultRefFormat files &&\n    -+\ttest_config_global init.defaultRefStorage files &&\n    ++\ttest_config_global init.defaultRefStorageFormat files &&\n      \n    - \tGIT_DEFAULT_REF_STORAGE=reftable git init refformat &&\n    + \tGIT_DEFAULT_REF_STORAGE_FORMAT=reftable git init refformat &&\n      \techo reftable >expect &&\n     @@ t/t0001-init.sh: test_expect_success \"init with feature.experimental=true\" '\n      \ttest_cmp expect actual\n      '\n      \n     -test_expect_success \"init.defaultRefFormat overrides feature.experimental=true\" '\n    -+test_expect_success \"init.defaultRefStorage overrides feature.experimental=true\" '\n    ++test_expect_success \"init.defaultRefStorageFormat overrides feature.experimental=true\" '\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \ttest_config_global feature.experimental true &&\n     -\ttest_config_global init.defaultRefFormat files &&\n    -+\ttest_config_global init.defaultRefStorage files &&\n    ++\ttest_config_global init.defaultRefStorageFormat files &&\n      \t(\n    - \t\tsane_unset GIT_DEFAULT_REF_STORAGE &&\n    + \t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n      \t\tgit init refformat\n11:  a7911f38dc ! 11:  e9c61c7d06 setup: allow \"git init --ref-storage=\" to specify a payload\n    @@ Metadata\n     Author: Patrick Steinhardt <ps@pks.im>\n     \n      ## Commit message ##\n    -    setup: allow \"git init --ref-storage=\" to specify a payload\n    +    setup: allow \"git init --ref-storage-format=\" to specify a payload\n     \n         Reference storage backends can be configured with a payload via the\n    -    \"extensions.refStorage\" config key and the \"GIT_REF_STORAGE\" environment\n    -    variable, both of which accept a URI in the format\n    +    \"extensions.refStorage\" config key and the \"GIT_REF_STORAGE_FORMAT\"\n    +    environment variable, both of which accept a URI in the format\n         \"<format>://<payload>\". The payload may contain backend-specific\n         information, for example an alternate refs directory or which database\n         references should be stored in.\n     \n    -    The `--ref-storage=` option of git-init(1) and git-clone(1) does not\n    -    know about payloads though: its value is parsed as a plain format name,\n    -    so backends that require a payload cannot be conveniently set up at\n    -    initialization time via the command line.\n    +    The `--ref-storage-format=` option of git-init(1) and git-clone(1) does\n    +    not know about payloads though: its value is parsed as a plain format\n    +    name, so backends that require a payload cannot be conveniently set up\n    +    at initialization time via the command line.\n     \n         Teach the option to accept the same URI syntax. Also, document the\n         optional payloads for both the \"files\" and \"reftable\" backends.\n    @@ Documentation/git-init.adoc\n     @@ Documentation/git-init.adoc: values are `sha1` and (if enabled) `sha256`.  `sha1` is the default.\n      include::object-format-disclaimer.adoc[]\n      \n    - `--ref-storage=<format>`::\n    + `--ref-storage-format=<format>`::\n     -Specify the given ref storage _<format>_ for the repository. The valid values are:\n     +Specify the given ref storage _<format>_ for the repository. Backends that\n     +require additional configuration accept a payload in the form\n    @@ Documentation/ref-storage-format.adoc\n     \n      ## builtin/clone.c ##\n     @@ builtin/clone.c: int cmd_clone(int argc,\n    + \tchar *option_origin = NULL;\n    + \tstruct string_list option_not = STRING_LIST_INIT_NODUP;\n    + \tconst char *real_git_dir = NULL;\n    +-\tconst char *ref_storage_format_str = NULL;\n    ++\tconst char *ref_storage_format_uri = NULL;\n    + \tconst char *option_upload_pack = \"git-upload-pack\";\n    + \tint option_progress = -1;\n    + \tint option_sparse_checkout = 0;\n    +@@ builtin/clone.c: int cmd_clone(int argc,\n    + \t\t\t N_(\"any cloned submodules will be shallow\")),\n    + \t\tOPT_STRING(0, \"separate-git-dir\", &real_git_dir, N_(\"gitdir\"),\n    + \t\t\t   N_(\"separate git dir from working tree\")),\n    +-\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n    ++\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_uri, N_(\"format\"),\n    + \t\t\t   N_(\"specify the reference storage format to use\")),\n    +-\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n    ++\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_uri, N_(\"format\"),\n    + \t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n    + \t\tOPT_STRING_LIST('c', \"config\", &option_config, N_(\"key=value\"),\n    + \t\t\t\tN_(\"set config inside the new repository\")),\n    +@@ builtin/clone.c: int cmd_clone(int argc,\n    + \tif (option_single_branch == -1)\n      \t\toption_single_branch = deepen ? 1 : 0;\n      \n    - \tif (ref_storage) {\n    --\t\tref_storage_format = ref_storage_format_by_name(ref_storage);\n    -+\t\tref_storage_format = ref_storage_format_by_uri(ref_storage, NULL);\n    +-\tif (ref_storage_format_str) {\n    +-\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n    ++\tif (ref_storage_format_uri) {\n    ++\t\tref_storage_format = ref_storage_format_by_uri(ref_storage_format_uri, NULL);\n      \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n    - \t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage);\n    +-\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n    ++\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_uri);\n      \t}\n    + \n    + \tif (option_mirror) {\n     @@ builtin/clone.c: int cmd_clone(int argc,\n      \t * their on-disk data structures.\n      \t */\n      \tinit_db(the_repository, git_dir, real_git_dir, work_tree, option_template,\n     -\t\tGIT_HASH_UNKNOWN, ref_storage_format, NULL,\n    -+\t\tGIT_HASH_UNKNOWN, ref_storage, NULL,\n    ++\t\tGIT_HASH_UNKNOWN, ref_storage_format_uri, NULL,\n      \t\tdo_not_override_repo_unix_permissions,\n      \t\tINIT_DB_QUIET | INIT_DB_SKIP_REFDB);\n      \n     \n      ## builtin/init-db.c ##\n     @@ builtin/init-db.c: int cmd_init_db(int argc,\n    - \tconst char *ref_storage = NULL;\n    + \tunsigned int flags = 0;\n    + \tint bare = startup_info->force_bare_repository ? 1 : -1;\n    + \tconst char *object_format = NULL;\n    +-\tconst char *ref_storage_format_str = NULL;\n    ++\tconst char *ref_storage_format_uri = NULL;\n      \tconst char *initial_branch = NULL;\n      \tint hash_algo = GIT_HASH_UNKNOWN;\n     -\tenum ref_storage_format ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;\n      \tint init_shared_repository = -1;\n      \tconst struct option init_db_options[] = {\n      \t\tOPT_STRING(0, \"template\", &template_dir, N_(\"template-directory\"),\n    +@@ builtin/init-db.c: int cmd_init_db(int argc,\n    + \t\t\t   N_(\"override the name of the initial branch\")),\n    + \t\tOPT_STRING(0, \"object-format\", &object_format, N_(\"hash\"),\n    + \t\t\t   N_(\"specify the hash algorithm to use\")),\n    +-\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n    ++\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_uri, N_(\"format\"),\n    + \t\t\t   N_(\"specify the reference storage format to use\")),\n    +-\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n    ++\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_uri, N_(\"format\"),\n    + \t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n    + \t\tOPT_END()\n    + \t};\n     @@ builtin/init-db.c: int cmd_init_db(int argc,\n      \t\t\tdie(_(\"unknown hash algorithm '%s'\"), object_format);\n      \t}\n      \n    --\tif (ref_storage) {\n    --\t\tref_storage_format = ref_storage_format_by_name(ref_storage);\n    +-\tif (ref_storage_format_str) {\n    +-\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n     -\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n    --\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage);\n    +-\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n     -\t}\n     -\n      \tif (init_shared_repository != -1)\n    @@ builtin/init-db.c: int cmd_init_db(int argc,\n      \tflags |= INIT_DB_EXIST_OK;\n      \tret = init_db(the_repository, git_dir, real_git_dir, work_tree,\n     -\t\t      template_dir, hash_algo, ref_storage_format, initial_branch,\n    -+\t\t      template_dir, hash_algo, ref_storage, initial_branch,\n    - \t\t      init_shared_repository, flags);\n    +-\t\t      init_shared_repository, flags);\n    ++\t\t      template_dir, hash_algo, ref_storage_format_uri,\n    ++\t\t      initial_branch, init_shared_repository, flags);\n      \n      \tfree(template_dir_to_free);\n    + \tfree(real_git_dir_to_free);\n     \n      ## setup.c ##\n     @@ setup.c: static int read_default_format_config(const char *key, const char *value,\n    @@ setup.c: static int read_default_format_config(const char *key, const char *valu\n      \n      static void repository_format_configure(struct repository_format *repo_fmt,\n     -\t\t\t\t\tint hash, enum ref_storage_format ref_storage_format)\n    -+\t\t\t\t\tint hash, const char *ref_storage_uri)\n    ++\t\t\t\t\tint hash,\n    ++\t\t\t\t\tconst char *ref_storage_format_uri)\n      {\n      \tstruct default_format_config cfg = {\n      \t\t.hash = GIT_HASH_UNKNOWN,\n    @@ setup.c: static void repository_format_configure(struct repository_format *repo_\n      \t */\n     -\tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n     -\t\t/* nothing to do */\n    -+\tif (ref_storage_uri) {\n    -+\t\tref_storage_format = ref_storage_format_by_uri(ref_storage_uri, &ref_storage_payload);\n    ++\tif (ref_storage_format_uri) {\n    ++\t\tref_storage_format = ref_storage_format_by_uri(ref_storage_format_uri,\n    ++\t\t\t\t\t\t\t       &ref_storage_payload);\n     +\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n    -+\t\t\tdie(_(\"unknown reference storage format specified via command line: '%s'\"),\n    -+\t\t\t    ref_storage_uri);\n    - \t} else if (((env = getenv(GIT_REF_STORAGE_ENVIRONMENT)) ||\n    ++\t\t\tdie(_(\"unknown ref storage format specified via command line: '%s'\"),\n    ++\t\t\t    ref_storage_format_uri);\n    + \t} else if (((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT)) ||\n      \t\t    (env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT)))) {\n      \t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n     @@ setup.c: int init_db(struct repository *repo,\n    @@ setup.c: int init_db(struct repository *repo,\n      \t    const char *worktree,\n      \t    const char *template_dir, int hash,\n     -\t    enum ref_storage_format ref_storage_format,\n    -+\t    const char *ref_storage_uri,\n    ++\t    const char *ref_storage_format_uri,\n      \t    const char *initial_branch,\n      \t    int init_shared_repository, unsigned int flags)\n      {\n    @@ setup.c: int init_db(struct repository *repo,\n      \t */\n      \tread_and_verify_repository_format(&repo_fmt, repo_get_git_dir(repo), NULL);\n     -\trepository_format_configure(&repo_fmt, hash, ref_storage_format);\n    -+\trepository_format_configure(&repo_fmt, hash, ref_storage_uri);\n    ++\trepository_format_configure(&repo_fmt, hash, ref_storage_format_uri);\n      \tif (apply_repository_format(repo, &repo_fmt, APPLY_REPOSITORY_FORMAT_HONOR_ENV, &err) < 0)\n      \t\tdie(\"%s\", err.buf);\n      \n    @@ setup.h: int init_db(struct repository *repo,\n      \t    const char *worktree,\n      \t    const char *template_dir, int hash_algo,\n     -\t    enum ref_storage_format ref_storage_format,\n    -+\t    const char *ref_storage_uri,\n    ++\t    const char *ref_storage_format_uri,\n      \t    const char *initial_branch, int init_shared_repository,\n      \t    unsigned int flags);\n      void initialize_repository_version(struct repository *repo,\n     \n      ## t/t0001-init.sh ##\n     @@ t/t0001-init.sh: done\n    - test_expect_success 'init with --ref-storage=garbage' '\n    + test_expect_success 'init with --ref-storage-format=garbage' '\n      \ttest_when_finished \"rm -rf refformat\" &&\n      \tcat >expect <<-EOF &&\n     -\tfatal: unknown ref storage format ${SQ}garbage${SQ}\n    -+\tfatal: unknown reference storage format specified via command line: ${SQ}garbage${SQ}\n    ++\tfatal: unknown ref storage format specified via command line: ${SQ}garbage${SQ}\n      \tEOF\n    - \ttest_must_fail git init --ref-storage=garbage refformat 2>err &&\n    + \ttest_must_fail git init --ref-storage-format=garbage refformat 2>err &&\n      \ttest_cmp expect err\n     \n      ## t/t1423-ref-backend.sh ##\n    @@ t/t1423-ref-backend.sh: test_expect_success 'initializing repository with alt re\n      \t)\n      '\n      \n    -+test_expect_success 'initializing repository with --ref-storage and payload' '\n    ++test_expect_success 'initializing repository with --ref-storage-format and payload' '\n     +\ttest_when_finished \"rm -rf repo refdir\" &&\n     +\tmkdir refdir &&\n     +\tBACKEND=\"$(test_detect_ref_format)://$(pwd)/refdir\" &&\n    -+\tgit init --ref-storage=\"$BACKEND\" repo &&\n    ++\tgit init --ref-storage-format=\"$BACKEND\" repo &&\n     +\tverify_files_exist repo/.git refdir &&\n     +\n     +\tgit -C repo config get extensions.refstorage >actual &&\n    @@ t/t1423-ref-backend.sh: test_expect_success 'initializing repository with alt re\n     +\t# Reinitializing the repository is fine when not specifying any format.\n     +\tgit -C repo init &&\n     +\t# Reinitializing with the same backend is fine, too.\n    -+\tgit -C repo init --ref-storage=\"$BACKEND\" &&\n    ++\tgit -C repo init --ref-storage-format=\"$BACKEND\" &&\n     +\t# Reinitializing without a payload should fail.\n    -+\ttest_must_fail git -C repo init --ref-storage=\"$(test_detect_ref_format)\" 2>err &&\n    ++\ttest_must_fail git -C repo init --ref-storage-format=\"$(test_detect_ref_format)\" 2>err &&\n     +\ttest_grep \"attempt to reinitialize repository with different reference storage payload\" err &&\n     +\t# Reinitializing with a different payload should fail, too.\n    -+\ttest_must_fail git -C repo init --ref-storage=\"$(test_detect_ref_format)://$(pwd)/other\" 2>err &&\n    ++\ttest_must_fail git -C repo init --ref-storage-format=\"$(test_detect_ref_format)://$(pwd)/other\" 2>err &&\n     +\ttest_grep \"attempt to reinitialize repository with different reference storage payload\" err &&\n     +\n     +\tgit -C repo config get extensions.refstorage >actual &&\n\n---\nbase-commit: 3cb9185f65410273787f74333cc027d2ea5daada\nchange-id: 20260904-b4-pks-unify-ref-storage-format-0c81fb038671\n\n"},{"id":"552123","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-1-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 01/11] builtin/init: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:35Z","receivedAt":"2026-09-07T11:20:13Z","isPatch":true,"body":"Back when we gained support for reftables we of course introduced the\nability to control the reference storage format that is used by newly\ncreated repositories. This infrastructure has grown over time, and\nunfortunately without consistency:\n\n  - The command line parameter to specify the ref storage format is\n    called \"--ref-format=\", while the corresponding repository extension\n    is called \"refStorage\".\n\n  - In most cases we refer to the \"ref storage format\" in our docs, so\n    calling it \"--ref-format=\" is being inconsistent with them.\n\n  - It is possible to override the ref storage format via an environment\n    variable that is called \"GIT_REFERENCE_BACKEND\", which is not even\n    remotely consistent with anything else.\n\n  - There is also an \"object format\", but that format does not control\n    how we store objects but rather whether we use SHA1 or SHA256.\n\nSo in summary, it's a huge mess.\n\nThis problem is about to become even worse though, as we're soon going\nto introduce an object storage extension. This extension is the\nequivalent to the ref storage extension, and of course we also want\nusers to be able to control which object storage format new repositories\nare using. But we cannot properly name that parameter without creating\neven more inconsistencies:\n\n  - \"--object-format=\" would match \"--ref-format=\", but that parameter\n    name is already taken to specify the hash function.\n\n  - \"--object-storage=\" would be a good fit, but be inconsistent with\n    \"--ref-format=\". Asking the user to execute `git init --ref-format=\n    --object-storage=` just feels extremely awkward.\n\nInstead, this and subsequent patches will fix the mess by consistently\nreferring to the ref storage format as such throughout all options,\nenvironment variables and config settings. This new name much more\nclosely indicates that it is about how we store data and finally brings\nconsistency into this area. We will keep the old names working of course\nfor the sake of backwards compatibility.\n\nStart with git-init(1).\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/config/init.adoc         |  2 +-\n Documentation/git-init.adoc            |  4 ++--\n Documentation/git.adoc                 |  2 +-\n builtin/init-db.c                      | 16 ++++++++-------\n t/perf/p1401-ref-store-tombstones.sh   |  4 ++--\n t/perf/perf-lib.sh                     |  2 +-\n t/t0001-init.sh                        | 24 +++++++++++------------\n t/t0610-reftable-basics.sh             | 14 ++++++-------\n t/t0611-reftable-httpd.sh              |  2 +-\n t/t1400-update-ref.sh                  |  2 +-\n t/t1423-ref-backend.sh                 |  6 +++---\n t/t1460-refs-migrate.sh                | 36 +++++++++++++++++-----------------\n t/t1900-repo-info.sh                   |  6 +++---\n t/t5510-fetch.sh                       |  8 ++++----\n t/t7424-submodule-mixed-ref-formats.sh |  2 +-\n 15 files changed, 66 insertions(+), 64 deletions(-)\n\ndiff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc\nindex 7b4abdaf8b..a048f0bddc 100644\n--- a/Documentation/config/init.adoc\n+++ b/Documentation/config/init.adoc\n@@ -15,7 +15,7 @@ endif::[]\n \tthis config.\n `init.defaultRefFormat`::\n \tAllows overriding the default ref storage format for new repositories.\n-\tSee `--ref-format=` in linkgit:git-init[1]. Both the command line\n+\tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n \toption and the `GIT_DEFAULT_REF_FORMAT` environment variable take\n \tprecedence over this config.\n \ndiff --git a/Documentation/git-init.adoc b/Documentation/git-init.adoc\nindex bab99b9b47..7e407d3ef1 100644\n--- a/Documentation/git-init.adoc\n+++ b/Documentation/git-init.adoc\n@@ -11,7 +11,7 @@ SYNOPSIS\n [synopsis]\n git init [-q | --quiet] [--bare] [--template=<template-directory>]\n \t [--separate-git-dir <git-dir>] [--object-format=<format>]\n-\t [--ref-format=<format>]\n+\t [--ref-storage-format=<format>]\n \t [-b <branch-name> | --initial-branch=<branch-name>]\n \t [--shared[=<permissions>]] [<directory>]\n \n@@ -57,7 +57,7 @@ values are `sha1` and (if enabled) `sha256`.  `sha1` is the default.\n +\n include::object-format-disclaimer.adoc[]\n \n-`--ref-format=<format>`::\n+`--ref-storage-format=<format>`::\n Specify the given ref storage _<format>_ for the repository. The valid values are:\n +\n include::ref-storage-format.adoc[]\ndiff --git a/Documentation/git.adoc b/Documentation/git.adoc\nindex 8a5cdd3b3d..23ba65656e 100644\n--- a/Documentation/git.adoc\n+++ b/Documentation/git.adoc\n@@ -593,7 +593,7 @@ double-quotes and respecting backslash escapes. E.g., the value\n `GIT_DEFAULT_REF_FORMAT`::\n \tIf this variable is set, the default reference backend format for new\n \trepositories will be set to this value. The default is \"files\".\n-\tSee `--ref-format` in linkgit:git-init[1].\n+\tSee `--ref-storage-format` in linkgit:git-init[1].\n \n `GIT_REFERENCE_BACKEND`::\n     Specify which reference backend to be used along with its URI.\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex e96b1283b7..63f33154c0 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -57,7 +57,7 @@ static int shared_callback(const struct option *opt, const char *arg, int unset)\n static const char *const init_db_usage[] = {\n \tN_(\"git init [-q | --quiet] [--bare] [--template=<template-directory>]\\n\"\n \t   \"         [--separate-git-dir <git-dir>] [--object-format=<format>]\\n\"\n-\t   \"         [--ref-format=<format>]\\n\"\n+\t   \"         [--ref-storage-format=<format>]\\n\"\n \t   \"         [-b <branch-name> | --initial-branch=<branch-name>]\\n\"\n \t   \"         [--shared[=<permissions>]] [<directory>]\"),\n \tNULL\n@@ -83,7 +83,7 @@ int cmd_init_db(int argc,\n \tunsigned int flags = 0;\n \tint bare = startup_info->force_bare_repository ? 1 : -1;\n \tconst char *object_format = NULL;\n-\tconst char *ref_format = NULL;\n+\tconst char *ref_storage_format_str = NULL;\n \tconst char *initial_branch = NULL;\n \tint hash_algo = GIT_HASH_UNKNOWN;\n \tenum ref_storage_format ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;\n@@ -109,8 +109,10 @@ int cmd_init_db(int argc,\n \t\t\t   N_(\"override the name of the initial branch\")),\n \t\tOPT_STRING(0, \"object-format\", &object_format, N_(\"hash\"),\n \t\t\t   N_(\"specify the hash algorithm to use\")),\n-\t\tOPT_STRING(0, \"ref-format\", &ref_format, N_(\"format\"),\n-\t\t\t   N_(\"specify the reference format to use\")),\n+\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\t\t   N_(\"specify the reference storage format to use\")),\n+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n \t\tOPT_END()\n \t};\n \tint ret;\n@@ -173,10 +175,10 @@ int cmd_init_db(int argc,\n \t\t\tdie(_(\"unknown hash algorithm '%s'\"), object_format);\n \t}\n \n-\tif (ref_format) {\n-\t\tref_storage_format = ref_storage_format_by_name(ref_format);\n+\tif (ref_storage_format_str) {\n+\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_format);\n+\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n \t}\n \n \tif (init_shared_repository != -1)\ndiff --git a/t/perf/p1401-ref-store-tombstones.sh b/t/perf/p1401-ref-store-tombstones.sh\nindex 9e3d8031aa..37ffe0c3a7 100755\n--- a/t/perf/p1401-ref-store-tombstones.sh\n+++ b/t/perf/p1401-ref-store-tombstones.sh\n@@ -5,7 +5,7 @@ test_description=\"Tests performance of ref operations with many tombstones\"\n . ./perf-lib.sh\n \n test_expect_success \"setup\" '\n-\tgit init --ref-format=reftable repo &&\n+\tgit init --ref-storage-format=reftable repo &&\n \tblob=$(echo foo | git -C repo hash-object -w --stdin) &&\n \tfor i in $(test_seq 8000)\n \tdo\n@@ -24,7 +24,7 @@ test_perf \"recreate refs after mass delete\" '\n '\n \n test_expect_success \"setup asymmetric\" '\n-\tgit init --ref-format=reftable repo2 &&\n+\tgit init --ref-storage-format=reftable repo2 &&\n \tblob=$(echo foo | git -C repo2 hash-object -w --stdin) &&\n \tfor i in $(test_seq 8000)\n \tdo\ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 2ac007888e..3ce49fd423 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -153,7 +153,7 @@ test_perf_create_repo_from () {\n \t) &&\n \t(\n \t\tcd \"$repo\" &&\n-\t\t\"$MODERN_GIT\" init -q --ref-format=\"$refformat\" --object-format=\"$objectformat\" &&\n+\t\t\"$MODERN_GIT\" init -q --ref-storage-format=\"$refformat\" --object-format=\"$objectformat\" &&\n \t\ttest_perf_do_repo_symlink_config_ &&\n \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null &&\n \t\tif test -f .git/index.lock\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 5cf2e5a35a..df9a2ff2da 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -696,9 +696,9 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"init with --ref-format=$format\" '\n+\ttest_expect_success \"init with --ref-storage-format=$format\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n-\t\tgit init --ref-format=$format refformat &&\n+\t\tgit init --ref-storage-format=$format refformat &&\n \t\techo $format >expect &&\n \t\tgit -C refformat rev-parse --show-ref-format >actual &&\n \t\ttest_cmp expect actual\n@@ -717,9 +717,9 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"--ref-format=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n+\ttest_expect_success \"--ref-storage-format=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n-\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-format=$format refformat &&\n+\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n \t\techo $format >expect &&\n \t\tgit -C refformat rev-parse --show-ref-format >actual &&\n \t\ttest_cmp expect actual\n@@ -735,9 +735,9 @@ do\n \t'\n done\n \n-test_expect_success \"--ref-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n+test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n-\tGIT_DEFAULT_REF_FORMAT=files git init --ref-format=reftable refformat &&\n+\tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&\n \techo reftable >expect &&\n \tgit -C refformat rev-parse --show-ref-format >actual &&\n \ttest_cmp expect actual\n@@ -791,8 +791,8 @@ for from_format in $backends\n do\n \ttest_expect_success \"re-init with same format ($from_format)\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n-\t\tgit init --ref-format=$from_format refformat &&\n-\t\tgit init --ref-format=$from_format refformat &&\n+\t\tgit init --ref-storage-format=$from_format refformat &&\n+\t\tgit init --ref-storage-format=$from_format refformat &&\n \t\techo $from_format >expect &&\n \t\tgit -C refformat rev-parse --show-ref-format >actual &&\n \t\ttest_cmp expect actual\n@@ -807,11 +807,11 @@ do\n \n \t\ttest_expect_success \"re-init with different format fails ($from_format -> $to_format)\" '\n \t\t\ttest_when_finished \"rm -rf refformat\" &&\n-\t\t\tgit init --ref-format=$from_format refformat &&\n+\t\t\tgit init --ref-storage-format=$from_format refformat &&\n \t\t\tcat >expect <<-EOF &&\n \t\t\tfatal: attempt to reinitialize repository with different reference storage format\n \t\t\tEOF\n-\t\t\ttest_must_fail git init --ref-format=$to_format refformat 2>err &&\n+\t\t\ttest_must_fail git init --ref-storage-format=$to_format refformat 2>err &&\n \t\t\ttest_cmp expect err &&\n \t\t\techo $from_format >expect &&\n \t\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n@@ -820,12 +820,12 @@ do\n \tdone\n done\n \n-test_expect_success 'init with --ref-format=garbage' '\n+test_expect_success 'init with --ref-storage-format=garbage' '\n \ttest_when_finished \"rm -rf refformat\" &&\n \tcat >expect <<-EOF &&\n \tfatal: unknown ref storage format ${SQ}garbage${SQ}\n \tEOF\n-\ttest_must_fail git init --ref-format=garbage refformat 2>err &&\n+\ttest_must_fail git init --ref-storage-format=garbage refformat 2>err &&\n \ttest_cmp expect err\n '\n \ndiff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh\nindex 35e98b43db..1cf96ce2c5 100755\n--- a/t/t0610-reftable-basics.sh\n+++ b/t/t0610-reftable-basics.sh\n@@ -59,28 +59,28 @@ test_expect_success 'init: reinitializing reftable backend succeeds' '\n \ttest_commit -C repo A &&\n \n \tgit -C repo for-each-ref >expect &&\n-\tgit init --ref-format=reftable repo &&\n+\tgit init --ref-storage-format=reftable repo &&\n \tgit -C repo for-each-ref >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'init: reinitializing files with reftable backend fails' '\n \ttest_when_finished \"rm -rf repo\" &&\n-\tgit init --ref-format=files repo &&\n+\tgit init --ref-storage-format=files repo &&\n \ttest_commit -C repo file &&\n \n \tcp repo/.git/HEAD expect &&\n-\ttest_must_fail git init --ref-format=reftable repo &&\n+\ttest_must_fail git init --ref-storage-format=reftable repo &&\n \ttest_cmp expect repo/.git/HEAD\n '\n \n test_expect_success 'init: reinitializing reftable with files backend fails' '\n \ttest_when_finished \"rm -rf repo\" &&\n-\tgit init --ref-format=reftable repo &&\n+\tgit init --ref-storage-format=reftable repo &&\n \ttest_commit -C repo file &&\n \n \tcp repo/.git/HEAD expect &&\n-\ttest_must_fail git init --ref-format=files repo &&\n+\ttest_must_fail git init --ref-storage-format=files repo &&\n \ttest_cmp expect repo/.git/HEAD\n '\n \n@@ -163,7 +163,7 @@ test_expect_success 'clone: can clone reftable repository' '\n \n test_expect_success 'clone: can clone reffiles into reftable repository' '\n \ttest_when_finished \"rm -rf reffiles reftable\" &&\n-\tgit init --ref-format=files reffiles &&\n+\tgit init --ref-storage-format=files reffiles &&\n \ttest_commit -C reffiles A &&\n \tgit clone --ref-format=reftable ./reffiles reftable &&\n \n@@ -182,7 +182,7 @@ test_expect_success 'clone: can clone reffiles into reftable repository' '\n \n test_expect_success 'clone: can clone reftable into reffiles repository' '\n \ttest_when_finished \"rm -rf reffiles reftable\" &&\n-\tgit init --ref-format=reftable reftable &&\n+\tgit init --ref-storage-format=reftable reftable &&\n \ttest_commit -C reftable A &&\n \tgit clone --ref-format=files ./reftable reffiles &&\n \ndiff --git a/t/t0611-reftable-httpd.sh b/t/t0611-reftable-httpd.sh\nindex 5e05b9c1f2..b030814b9f 100755\n--- a/t/t0611-reftable-httpd.sh\n+++ b/t/t0611-reftable-httpd.sh\n@@ -10,7 +10,7 @@ start_httpd\n REPO=\"$HTTPD_DOCUMENT_ROOT_PATH/repo\"\n \n test_expect_success 'serving ls-remote' '\n-\tgit init --ref-format=reftable -b main \"$REPO\" &&\n+\tgit init --ref-storage-format=reftable -b main \"$REPO\" &&\n \tcd \"$REPO\" &&\n \ttest_commit m1 &&\n \t>.git/git-daemon-export-ok &&\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex 269fdaa3ed..1a164c96f9 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -2361,7 +2361,7 @@ do\n \t'\n \n \ttest_expect_success CASE_INSENSITIVE_FS \"stdin $type batch-updates existing reference\" '\n-\t\tgit init --ref-format=reftable repo &&\n+\t\tgit init --ref-storage-format=reftable repo &&\n \t\ttest_when_finished \"rm -fr repo\" &&\n \t\t(\n \t\t\tcd repo &&\ndiff --git a/t/t1423-ref-backend.sh b/t/t1423-ref-backend.sh\nindex fd47d77e8e..9ae295cf3d 100755\n--- a/t/t1423-ref-backend.sh\n+++ b/t/t1423-ref-backend.sh\n@@ -137,7 +137,7 @@ do\n \n \t\ttest_expect_success \"$method: read from $to_format backend, $dir dir\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\t(\n \t\t\t\tcd repo &&\n \t\t\t\ttest_commit 1 &&\n@@ -152,7 +152,7 @@ do\n \n \t\ttest_expect_success \"$method: write to $to_format backend, $dir dir\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\t(\n \t\t\t\tcd repo &&\n \t\t\t\ttest_commit 1 &&\n@@ -179,7 +179,7 @@ do\n \n \t\ttest_expect_success \"$method: with worktree and $to_format backend, $dir dir\" '\n \t\t\ttest_when_finished \"rm -rf repo wt\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\t(\n \t\t\t\tcd repo &&\n \t\t\t\ttest_commit 1 &&\ndiff --git a/t/t1460-refs-migrate.sh b/t/t1460-refs-migrate.sh\nindex 8f42697143..bb2507f571 100755\n--- a/t/t1460-refs-migrate.sh\n+++ b/t/t1460-refs-migrate.sh\n@@ -105,7 +105,7 @@ do\n \n \t\ttest_expect_success \"$from_format: migration to same format fails\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_must_fail git -C repo refs migrate \\\n \t\t\t\t--ref-format=$from_format 2>err &&\n \t\t\tcat >expect <<-EOF &&\n@@ -116,7 +116,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: migration with worktree fails\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\tgit -C repo worktree add wt &&\n \t\t\ttest_must_fail git -C repo refs migrate \\\n \t\t\t\t--ref-format=$to_format 2>err &&\n@@ -128,20 +128,20 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: unborn HEAD\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_migration repo \"$to_format\"\n \t\t'\n \n \t\ttest_expect_success \"$from_format -> $to_format: single ref\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\ttest_migration repo \"$to_format\"\n \t\t'\n \n \t\ttest_expect_success \"$from_format -> $to_format: bare repository\" '\n \t\t\ttest_when_finished \"rm -rf repo repo.git\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\tgit clone --ref-format=$from_format --mirror repo repo.git &&\n \t\t\ttest_migration repo.git \"$to_format\"\n@@ -149,7 +149,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: dangling symref\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\tgit -C repo symbolic-ref BROKEN_HEAD refs/heads/nonexistent &&\n \t\t\ttest_migration repo \"$to_format\" &&\n@@ -160,7 +160,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: broken ref\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\ttest-tool -C repo ref-store main update-ref \"\" refs/heads/broken \\\n \t\t\t\t\"$(test_oid 001)\" \"$ZERO_OID\" REF_SKIP_CREATE_REFLOG,REF_SKIP_OID_VERIFICATION &&\n@@ -172,7 +172,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: pseudo-refs\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\tgit -C repo update-ref FOO_HEAD HEAD &&\n \t\t\ttest_migration repo \"$to_format\"\n@@ -180,7 +180,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: special refs are left alone\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\tgit -C repo rev-parse HEAD >repo/.git/MERGE_HEAD &&\n \t\t\tgit -C repo rev-parse MERGE_HEAD &&\n@@ -190,7 +190,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: a bunch of refs\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \n \t\t\ttest_commit -C repo initial &&\n \t\t\tcat >input <<-EOF &&\n@@ -208,7 +208,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: dry-run migration does not modify repository\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\tgit -C repo refs migrate --dry-run \\\n \t\t\t\t--ref-format=$to_format >output &&\n@@ -221,7 +221,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: reflogs of symrefs with target deleted\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\tgit -C repo branch branch-1 HEAD &&\n \t\t\tgit -C repo symbolic-ref refs/heads/symref refs/heads/branch-1 &&\n@@ -234,7 +234,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: reflogs order is retained\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit --date \"100005000 +0700\" --no-tag -C repo initial &&\n \t\t\ttest_commit --date \"100003000 +0700\" --no-tag -C repo second &&\n \t\t\ttest_migration repo \"$to_format\"\n@@ -242,7 +242,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: stash is retained\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\t(\n \t\t\t\tcd repo &&\n \t\t\t\ttest_commit initial A &&\n@@ -259,7 +259,7 @@ do\n \n \t\ttest_expect_success \"$from_format -> $to_format: skip reflog with --skip-reflog\" '\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n-\t\t\tgit init --ref-format=$from_format repo &&\n+\t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\t# we see that the repository contains reflogs.\n \t\t\tgit -C repo reflog --all >reflogs &&\n@@ -274,7 +274,7 @@ done\n \n test_expect_success 'multiple reftable blocks with multiple entries' '\n \ttest_when_finished \"rm -rf repo\" &&\n-\tgit init --ref-format=files repo &&\n+\tgit init --ref-storage-format=files repo &&\n \ttest_commit -C repo first &&\n \ttest_seq -f \"create refs/heads/ref-%d HEAD\" 5000 |\n \tgit -C repo update-ref --stdin &&\n@@ -286,7 +286,7 @@ test_expect_success 'multiple reftable blocks with multiple entries' '\n \n test_expect_success 'migrating from files format deletes backend files' '\n \ttest_when_finished \"rm -rf repo\" &&\n-\tgit init --ref-format=files repo &&\n+\tgit init --ref-storage-format=files repo &&\n \ttest_commit -C repo first &&\n \tgit -C repo pack-refs --all &&\n \ttest_commit -C repo second &&\n@@ -313,7 +313,7 @@ test_expect_success 'migrating from files format deletes backend files' '\n \n test_expect_success 'migrating from reftable format deletes backend files' '\n \ttest_when_finished \"rm -rf repo\" &&\n-\tgit init --ref-format=reftable repo &&\n+\tgit init --ref-storage-format=reftable repo &&\n \ttest_commit -C repo first &&\n \n \ttest_path_is_dir repo/.git/reftable &&\ndiff --git a/t/t1900-repo-info.sh b/t/t1900-repo-info.sh\nindex c85d390f43..d115d2d9f9 100755\n--- a/t/t1900-repo-info.sh\n+++ b/t/t1900-repo-info.sh\n@@ -39,10 +39,10 @@ test_repo_info () {\n }\n \n test_repo_info 'ref format files is retrieved correctly' \\\n-\t'git init --ref-format=files' 'format-files' 'references.format' 'files'\n+\t'git init --ref-storage-format=files' 'format-files' 'references.format' 'files'\n \n test_repo_info 'ref format reftable is retrieved correctly' \\\n-\t'git init --ref-format=reftable' 'format-reftable' 'references.format' 'reftable'\n+\t'git init --ref-storage-format=reftable' 'format-reftable' 'references.format' 'reftable'\n \n test_repo_info 'bare repository = false is retrieved correctly' \\\n \t'git init' 'nonbare' 'layout.bare' 'false'\n@@ -75,7 +75,7 @@ test_expect_success 'values returned in order requested' '\n \treferences.format=files\n \tlayout.bare=false\n \tEOF\n-\tgit init --ref-format=files ordered &&\n+\tgit init --ref-storage-format=files ordered &&\n \tgit -C ordered repo info layout.bare references.format layout.bare >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex a8d38d9176..359c3cf99b 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -1803,7 +1803,7 @@ test_expect_success CASE_INSENSITIVE_FS,REFFILES 'existing references in a case\n test_expect_success REFFILES 'existing reference lock in repo' '\n \ttest_when_finished rm -rf base repo &&\n \t(\n-\t\tgit init --ref-format=reftable base &&\n+\t\tgit init --ref-storage-format=reftable base &&\n \t\tcd base &&\n \t\techo >file update &&\n \t\tgit add . &&\n@@ -1814,7 +1814,7 @@ test_expect_success REFFILES 'existing reference lock in repo' '\n \t\tgit update-ref refs/heads/branch @ &&\n \t\tcd .. &&\n \n-\t\tgit init --ref-format=files --bare repo &&\n+\t\tgit init --ref-storage-format=files --bare repo &&\n \t\tcd repo &&\n \t\tgit remote add origin ../base &&\n \t\ttouch refs/heads/foo.lock &&\n@@ -1857,7 +1857,7 @@ test_expect_success CASE_INSENSITIVE_FS,REFFILES 'D/F conflict on case insensiti\n test_expect_success REFFILES 'D/F conflict on case sensitive filesystem with lock' '\n \ttest_when_finished rm -rf base repo &&\n \t(\n-\t\tgit init --ref-format=reftable base &&\n+\t\tgit init --ref-storage-format=reftable base &&\n \t\tcd base &&\n \t\techo >file update &&\n \t\tgit add . &&\n@@ -1868,7 +1868,7 @@ test_expect_success REFFILES 'D/F conflict on case sensitive filesystem with loc\n \t\tgit update-ref refs/heads/branch @ &&\n \t\tcd .. &&\n \n-\t\tgit init --ref-format=files --bare repo &&\n+\t\tgit init --ref-storage-format=files --bare repo &&\n \t\tcd repo &&\n \t\tgit remote add origin ../base &&\n \t\tmkdir refs/heads/foo &&\ndiff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\nindex 559713b607..1ca245c732 100755\n--- a/t/t7424-submodule-mixed-ref-formats.sh\n+++ b/t/t7424-submodule-mixed-ref-formats.sh\n@@ -31,7 +31,7 @@ test_expect_success 'add existing repository with different ref storage format'\n \t(\n \t\tcd parent &&\n \t\ttest_commit parent &&\n-\t\tgit init --ref-format=$OTHER_FORMAT submodule &&\n+\t\tgit init --ref-storage-format=$OTHER_FORMAT submodule &&\n \t\ttest_commit -C submodule submodule &&\n \t\tgit submodule add ./submodule\n \t)\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552124","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-2-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 02/11] builtin/clone: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:36Z","receivedAt":"2026-09-07T11:20:15Z","isPatch":true,"body":"With the same reasoning as for git-init(1), rename \"--ref-format=\" to\n\"--ref-storage-format=\" and keep the old name as an alias.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/git-clone.adoc           |  2 +-\n builtin/clone.c                        | 14 ++++++++------\n t/t0610-reftable-basics.sh             |  4 ++--\n t/t1460-refs-migrate.sh                |  2 +-\n t/t5510-fetch.sh                       |  6 +++---\n t/t5601-clone.sh                       |  4 ++--\n t/t7424-submodule-mixed-ref-formats.sh |  4 ++--\n 7 files changed, 19 insertions(+), 17 deletions(-)\n\ndiff --git a/Documentation/git-clone.adoc b/Documentation/git-clone.adoc\nindex b6e1f8ada2..f5d88d2aae 100644\n--- a/Documentation/git-clone.adoc\n+++ b/Documentation/git-clone.adoc\n@@ -348,7 +348,7 @@ or `--mirror` is given)\n \tThe result is Git repository can be separated from working\n \ttree.\n \n-`--ref-format=<ref-format>`::\n+`--ref-storage-format=<format>`::\n \n Specify the given ref storage format for the repository. The valid values are:\n +\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 5b25cca510..511fff9562 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -901,7 +901,7 @@ int cmd_clone(int argc,\n \tchar *option_origin = NULL;\n \tstruct string_list option_not = STRING_LIST_INIT_NODUP;\n \tconst char *real_git_dir = NULL;\n-\tconst char *ref_format = NULL;\n+\tconst char *ref_storage_format_str = NULL;\n \tconst char *option_upload_pack = \"git-upload-pack\";\n \tint option_progress = -1;\n \tint option_sparse_checkout = 0;\n@@ -981,8 +981,10 @@ int cmd_clone(int argc,\n \t\t\t N_(\"any cloned submodules will be shallow\")),\n \t\tOPT_STRING(0, \"separate-git-dir\", &real_git_dir, N_(\"gitdir\"),\n \t\t\t   N_(\"separate git dir from working tree\")),\n-\t\tOPT_STRING(0, \"ref-format\", &ref_format, N_(\"format\"),\n-\t\t\t   N_(\"specify the reference format to use\")),\n+\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\t\t   N_(\"specify the reference storage format to use\")),\n+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n \t\tOPT_STRING_LIST('c', \"config\", &option_config, N_(\"key=value\"),\n \t\t\t\tN_(\"set config inside the new repository\")),\n \t\tOPT_STRING_LIST(0, \"server-option\", &server_options,\n@@ -1027,10 +1029,10 @@ int cmd_clone(int argc,\n \tif (option_single_branch == -1)\n \t\toption_single_branch = deepen ? 1 : 0;\n \n-\tif (ref_format) {\n-\t\tref_storage_format = ref_storage_format_by_name(ref_format);\n+\tif (ref_storage_format_str) {\n+\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_format);\n+\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n \t}\n \n \tif (option_mirror) {\ndiff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh\nindex 1cf96ce2c5..d325f17a14 100755\n--- a/t/t0610-reftable-basics.sh\n+++ b/t/t0610-reftable-basics.sh\n@@ -165,7 +165,7 @@ test_expect_success 'clone: can clone reffiles into reftable repository' '\n \ttest_when_finished \"rm -rf reffiles reftable\" &&\n \tgit init --ref-storage-format=files reffiles &&\n \ttest_commit -C reffiles A &&\n-\tgit clone --ref-format=reftable ./reffiles reftable &&\n+\tgit clone --ref-storage-format=reftable ./reffiles reftable &&\n \n \tgit -C reffiles rev-parse HEAD >expect &&\n \tgit -C reftable rev-parse HEAD >actual &&\n@@ -184,7 +184,7 @@ test_expect_success 'clone: can clone reftable into reffiles repository' '\n \ttest_when_finished \"rm -rf reffiles reftable\" &&\n \tgit init --ref-storage-format=reftable reftable &&\n \ttest_commit -C reftable A &&\n-\tgit clone --ref-format=files ./reftable reffiles &&\n+\tgit clone --ref-storage-format=files ./reftable reffiles &&\n \n \tgit -C reftable rev-parse HEAD >expect &&\n \tgit -C reffiles rev-parse HEAD >actual &&\ndiff --git a/t/t1460-refs-migrate.sh b/t/t1460-refs-migrate.sh\nindex bb2507f571..8aded6597e 100755\n--- a/t/t1460-refs-migrate.sh\n+++ b/t/t1460-refs-migrate.sh\n@@ -143,7 +143,7 @@ do\n \t\t\ttest_when_finished \"rm -rf repo repo.git\" &&\n \t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n-\t\t\tgit clone --ref-format=$from_format --mirror repo repo.git &&\n+\t\t\tgit clone --ref-storage-format=$from_format --mirror repo repo.git &&\n \t\t\ttest_migration repo.git \"$to_format\"\n \t\t'\n \ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 359c3cf99b..300bd5396d 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -46,19 +46,19 @@ test_expect_success \"clone and setup child repos\" '\n \t) &&\n \tgit clone . bundle &&\n \tgit clone . seven &&\n-\tgit clone --ref-format=reftable . case_sensitive &&\n+\tgit clone --ref-storage-format=reftable . case_sensitive &&\n \t(\n \t\tcd case_sensitive &&\n \t\tgit branch branch1 &&\n \t\tgit branch bRanch1\n \t) &&\n-\tgit clone --ref-format=reftable . case_sensitive_fd &&\n+\tgit clone --ref-storage-format=reftable . case_sensitive_fd &&\n \t(\n \t\tcd case_sensitive_fd &&\n \t\tgit branch foo/bar &&\n \t\tgit branch Foo\n \t) &&\n-\tgit clone --ref-format=reftable . case_sensitive_df &&\n+\tgit clone --ref-storage-format=reftable . case_sensitive_df &&\n \t(\n \t\tcd case_sensitive_df &&\n \t\tgit branch Foo/bar &&\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex b6167582a1..202d86bc83 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -166,7 +166,7 @@ test_expect_success 'clone --mirror does not repeat tags' '\n \n test_expect_success 'clone with files ref format' '\n \ttest_when_finished \"rm -rf ref-storage\" &&\n-\tgit clone --ref-format=files --mirror src ref-storage &&\n+\tgit clone --ref-storage-format=files --mirror src ref-storage &&\n \techo files >expect &&\n \tgit -C ref-storage rev-parse --show-ref-format >actual &&\n \ttest_cmp expect actual\n@@ -176,7 +176,7 @@ test_expect_success 'clone with garbage ref format' '\n \tcat >expect <<-EOF &&\n \tfatal: unknown ref storage format ${SQ}garbage${SQ}\n \tEOF\n-\ttest_must_fail git clone --ref-format=garbage --mirror src ref-storage 2>err &&\n+\ttest_must_fail git clone --ref-storage-format=garbage --mirror src ref-storage 2>err &&\n \ttest_cmp expect err &&\n \ttest_path_is_missing ref-storage\n '\ndiff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\nindex 1ca245c732..5eaf689d74 100755\n--- a/t/t7424-submodule-mixed-ref-formats.sh\n+++ b/t/t7424-submodule-mixed-ref-formats.sh\n@@ -63,9 +63,9 @@ test_expect_success 'recursive clone propagates ref storage format' '\n \ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_FORMAT\" &&\n \n \t# The cloned repositories should use the other ref format that we have\n-\t# specified via `--ref-format`. The option should propagate to cloned\n+\t# specified via `--ref-storage`. The option should propagate to cloned\n \t# submodules.\n-\tgit clone --ref-format=$OTHER_FORMAT --recurse-submodules \\\n+\tgit clone --ref-storage-format=$OTHER_FORMAT --recurse-submodules \\\n \t\tupstream downstream &&\n \ttest_ref_format downstream \"$OTHER_FORMAT\" &&\n \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\"\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552126","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-3-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 03/11] builtin/refs: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:37Z","receivedAt":"2026-09-07T11:20:18Z","isPatch":true,"body":"With the same reasoning as for git-init(1), rename \"--ref-format=\" to\n\"--ref-storage-format=\" and keep the old name as an alias.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/git-refs.adoc            |  6 +++---\n builtin/fetch.c                        |  2 +-\n builtin/refs.c                         | 11 +++++++----\n t/t1423-ref-backend.sh                 |  8 ++++----\n t/t1460-refs-migrate.sh                | 12 ++++++------\n t/t7424-submodule-mixed-ref-formats.sh |  2 +-\n 6 files changed, 22 insertions(+), 19 deletions(-)\n\ndiff --git a/Documentation/git-refs.adoc b/Documentation/git-refs.adoc\nindex 9063892651..09e9bde939 100644\n--- a/Documentation/git-refs.adoc\n+++ b/Documentation/git-refs.adoc\n@@ -9,7 +9,7 @@ git-refs - Low-level access to refs\n SYNOPSIS\n --------\n [synopsis]\n-git refs migrate --ref-format=<format> [--no-reflog] [--dry-run]\n+git refs migrate --ref-storage-format=<format> [--no-reflog] [--dry-run]\n git refs verify [--strict] [--verbose]\n git refs list [--count=<count>] [--shell|--perl|--python|--tcl]\n \t\t   [(--sort=<key>)...] [--format=<format>]\n@@ -97,8 +97,8 @@ OPTIONS\n \n The following options are specific to `git refs migrate`:\n \n-`--ref-format=<format>`::\n-\tThe ref format to migrate the ref store to. Can be one of:\n+`--ref-storage-format=<format>`::\n+\tThe ref storage format to migrate the ref store to. Can be one of:\n +\n include::ref-storage-format.adoc[]\n \ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex ab7db2be06..687909c0c4 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1848,7 +1848,7 @@ static void ref_transaction_rejection_handler(const char *refname,\n \t\t\t\"can either accept this as-is, in which case you won't be able to\\n\"\n \t\t\t\"store all remote references on disk. Or you can alternatively\\n\"\n \t\t\t\"migrate your repository to use the 'reftable' backend with the\\n\"\n-\t\t\t\"following command:\\n\\n    git refs migrate --ref-format=reftable\\n\\n\"\n+\t\t\t\"following command:\\n\\n    git refs migrate --ref-storage-format=reftable\\n\\n\"\n \t\t\t\"Please keep in mind that not all implementations of Git support this\\n\"\n \t\t\t\"new format yet. So if you use tools other than Git to access this\\n\"\n \t\t\t\"repository it may not be an option to migrate to reftables.\\n\"));\ndiff --git a/builtin/refs.c b/builtin/refs.c\nindex 5cd21c25fe..53b12accaf 100644\n--- a/builtin/refs.c\n+++ b/builtin/refs.c\n@@ -10,7 +10,7 @@\n #include \"refs/refs-internal.h\"\n \n #define REFS_MIGRATE_USAGE \\\n-\tN_(\"git refs migrate --ref-format=<format> [--no-reflog] [--dry-run]\")\n+\tN_(\"git refs migrate --ref-storage-format=<format> [--no-reflog] [--dry-run]\")\n \n #define REFS_VERIFY_USAGE \\\n \tN_(\"git refs verify [--strict] [--verbose]\")\n@@ -44,9 +44,12 @@ static int cmd_refs_migrate(int argc, const char **argv, const char *prefix,\n \tenum ref_storage_format format;\n \tunsigned int flags = 0;\n \tstruct option options[] = {\n-\t\tOPT_STRING_F(0, \"ref-format\", &format_str, N_(\"format\"),\n-\t\t\tN_(\"specify the reference format to convert to\"),\n+\t\tOPT_STRING_F(0, \"ref-storage-format\", &format_str, N_(\"format\"),\n+\t\t\tN_(\"specify the reference storage format to convert to\"),\n \t\t\tPARSE_OPT_NONEG),\n+\t\tOPT_STRING_F(0, \"ref-format\", &format_str, N_(\"format\"),\n+\t\t\tN_(\"specify the reference storage format to convert to\"),\n+\t\t\tPARSE_OPT_NONEG | PARSE_OPT_HIDDEN),\n \t\tOPT_BIT(0, \"dry-run\", &flags,\n \t\t\tN_(\"perform a non-destructive dry-run\"),\n \t\t\tREPO_MIGRATE_REF_STORAGE_FORMAT_DRYRUN),\n@@ -62,7 +65,7 @@ static int cmd_refs_migrate(int argc, const char **argv, const char *prefix,\n \tif (argc)\n \t\tusage(_(\"too many arguments\"));\n \tif (!format_str)\n-\t\tusage(_(\"missing --ref-format=<format>\"));\n+\t\tusage(_(\"missing --ref-storage-format=<format>\"));\n \n \tformat = ref_storage_format_by_name(format_str);\n \tif (format == REF_STORAGE_FORMAT_UNKNOWN) {\ndiff --git a/t/t1423-ref-backend.sh b/t/t1423-ref-backend.sh\nindex 9ae295cf3d..ab119a6568 100755\n--- a/t/t1423-ref-backend.sh\n+++ b/t/t1423-ref-backend.sh\n@@ -144,7 +144,7 @@ do\n \t\t\t\ttest_commit 2 &&\n \t\t\t\ttest_commit 3 &&\n \n-\t\t\t\tgit refs migrate --dry-run --ref-format=$to_format >out &&\n+\t\t\t\tgit refs migrate --dry-run --ref-storage-format=$to_format >out &&\n \t\t\t\tBACKEND_PATH=\"$dir/$(sed \"s/.* ${SQ}.git\\/\\(.*\\)${SQ}/\\1/\" out)\" &&\n \t\t\t\ttest_refs_backend . $from_format \"$to_format://$BACKEND_PATH\" \"$method\"\n \t\t\t)\n@@ -159,7 +159,7 @@ do\n \t\t\t\ttest_commit 2 &&\n \t\t\t\ttest_commit 3 &&\n \n-\t\t\t\tgit refs migrate --dry-run --ref-format=$to_format >out &&\n+\t\t\t\tgit refs migrate --dry-run --ref-storage-format=$to_format >out &&\n \t\t\t\tBACKEND_PATH=\"$dir/$(sed \"s/.* ${SQ}.git\\/\\(.*\\)${SQ}/\\1/\" out)\" &&\n \n \t\t\t\ttest_refs_backend . $from_format \"$to_format://$BACKEND_PATH\" \"$method\" &&\n@@ -186,7 +186,7 @@ do\n \t\t\t\ttest_commit 2 &&\n \t\t\t\ttest_commit 3 &&\n \n-\t\t\t\tgit refs migrate --dry-run --ref-format=$to_format >out &&\n+\t\t\t\tgit refs migrate --dry-run --ref-storage-format=$to_format >out &&\n \t\t\t\tBACKEND_PATH=\"$dir/$(sed \"s/.* ${SQ}.git\\/\\(.*\\)${SQ}/\\1/\" out)\" &&\n \n \t\t\t\trun_with_uri . \"$from_format\" \"$to_format://$BACKEND_PATH\" \\\n@@ -218,7 +218,7 @@ do\n \t\t\ttest_commit 2 &&\n \t\t\ttest_commit 3 &&\n \n-\t\t\tgit refs migrate --ref-format=$to_format &&\n+\t\t\tgit refs migrate --ref-storage-format=$to_format &&\n \t\t\tgit refs list >out &&\n \t\t\ttest_grep \"refs/tags/1\"\tout &&\n \t\t\ttest_grep \"refs/tags/2\"\tout &&\ndiff --git a/t/t1460-refs-migrate.sh b/t/t1460-refs-migrate.sh\nindex 8aded6597e..204dd79b41 100755\n--- a/t/t1460-refs-migrate.sh\n+++ b/t/t1460-refs-migrate.sh\n@@ -42,7 +42,7 @@ test_migration () {\n \t\tprint_all_reflog_entries \"$repo\" >expect_logs\n \tfi &&\n \n-\tgit -C \"$repo\" refs migrate --ref-format=\"$format\" \"$@\" &&\n+\tgit -C \"$repo\" refs migrate --ref-storage-format=\"$format\" \"$@\" &&\n \n \tgit -C \"$repo\" for-each-ref --include-root-refs \\\n \t\t--format='%(refname) %(objectname) %(symref)' >actual &&\n@@ -77,7 +77,7 @@ test_expect_success \"missing ref storage format\" '\n \tgit init repo &&\n \ttest_must_fail git -C repo refs migrate 2>err &&\n \tcat >expect <<-EOF &&\n-\tusage: missing --ref-format=<format>\n+\tusage: missing --ref-storage-format=<format>\n \tEOF\n \ttest_cmp expect err\n '\n@@ -86,7 +86,7 @@ test_expect_success \"unknown ref storage format\" '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit init repo &&\n \ttest_must_fail git -C repo refs migrate \\\n-\t\t--ref-format=unknown 2>err &&\n+\t\t--ref-storage-format=unknown 2>err &&\n \tcat >expect <<-EOF &&\n \terror: unknown ref storage format ${SQ}unknown${SQ}\n \tEOF\n@@ -107,7 +107,7 @@ do\n \t\t\ttest_when_finished \"rm -rf repo\" &&\n \t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_must_fail git -C repo refs migrate \\\n-\t\t\t\t--ref-format=$from_format 2>err &&\n+\t\t\t\t--ref-storage-format=$from_format 2>err &&\n \t\t\tcat >expect <<-EOF &&\n \t\t\terror: repository already uses ${SQ}$from_format${SQ} format\n \t\t\tEOF\n@@ -119,7 +119,7 @@ do\n \t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\tgit -C repo worktree add wt &&\n \t\t\ttest_must_fail git -C repo refs migrate \\\n-\t\t\t\t--ref-format=$to_format 2>err &&\n+\t\t\t\t--ref-storage-format=$to_format 2>err &&\n \t\t\tcat >expect <<-EOF &&\n \t\t\terror: migrating repositories with worktrees is not supported yet\n \t\t\tEOF\n@@ -211,7 +211,7 @@ do\n \t\t\tgit init --ref-storage-format=$from_format repo &&\n \t\t\ttest_commit -C repo initial &&\n \t\t\tgit -C repo refs migrate --dry-run \\\n-\t\t\t\t--ref-format=$to_format >output &&\n+\t\t\t\t--ref-storage-format=$to_format >output &&\n \t\t\ttest_grep \"Finished dry-run migration of refs\" output &&\n \t\t\ttest_path_is_dir repo/.git/ref_migration.* &&\n \t\t\techo $from_format >expect &&\ndiff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\nindex 5eaf689d74..9081401509 100755\n--- a/t/t7424-submodule-mixed-ref-formats.sh\n+++ b/t/t7424-submodule-mixed-ref-formats.sh\n@@ -94,7 +94,7 @@ test_expect_success 'status with mixed submodule ref storages' '\n \tgit init main &&\n \tgit -C main submodule add \"file://$(pwd)/submodule\" &&\n \tgit -C main commit -m \"add submodule\" &&\n-\tgit -C main/submodule refs migrate --ref-format=$OTHER_FORMAT &&\n+\tgit -C main/submodule refs migrate --ref-storage-format=$OTHER_FORMAT &&\n \n \t# The main repository should use the default ref format now, whereas\n \t# the submodule should use the other format.\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552127","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-4-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 04/11] builtin/submodule: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:38Z","receivedAt":"2026-09-07T11:20:21Z","isPatch":true,"body":"With the same reasoning as for git-init(1), rename \"--ref-format=\" to\n\"--ref-storage-format=\" and keep the old name as an alias.\n\nNote that this commit is a bit more complex compared to the others as we\nalso need to adapt the submodule helper for consistency. But overall,\nthe changes are straight-forward and in the same spirit.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/git-submodule.adoc       |  8 ++++----\n builtin/clone.c                        |  2 +-\n builtin/submodule--helper.c            | 24 +++++++++++++++---------\n git-submodule.sh                       | 20 ++++++++++----------\n t/t7424-submodule-mixed-ref-formats.sh |  8 ++++----\n 5 files changed, 34 insertions(+), 28 deletions(-)\n\ndiff --git a/Documentation/git-submodule.adoc b/Documentation/git-submodule.adoc\nindex 722d827908..d22fd4a5b0 100644\n--- a/Documentation/git-submodule.adoc\n+++ b/Documentation/git-submodule.adoc\n@@ -34,7 +34,7 @@ COMMANDS\n With no arguments, shows the status of existing submodules.  Several\n subcommands are available to perform operations on the submodules.\n \n-`add [-b <branch>] [-f | --force] [--name <name>] [--reference <repository>] [--ref-format <format>] [--depth <depth>] [--] <repository> [<path>]`::\n+`add [-b <branch>] [-f | --force] [--name <name>] [--reference <repository>] [--ref-storage-format <format>] [--depth <depth>] [--] <repository> [<path>]`::\n \tAdd the given repository as a submodule at the given path\n \tto the changeset to be committed next to the current\n \tproject: the current project is termed the \"superproject\".\n@@ -72,7 +72,7 @@ location, and only the superproject's URL needs to be provided.\n git-submodule will correctly locate the submodule using the relative\n URL in `.gitmodules`.\n +\n-If `--ref-format <format>`  is specified, the ref storage format of newly\n+If `--ref-storage-format <format>`  is specified, the ref storage format of newly\n cloned submodules will be set accordingly.\n \n `status [--cached] [--recursive] [--] [<path>...]`::\n@@ -139,7 +139,7 @@ If you really want to remove a submodule from the repository and commit\n that use linkgit:git-rm[1] instead. See linkgit:gitsubmodules[7] for removal\n options.\n \n-`update [--init] [--remote] [-N | --no-fetch] [--[no-]recommend-shallow] [-f | --force] [--checkout | --rebase | --merge] [--reference=<repository>] [--ref-format=<format>] [--depth=<depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--filter=<filter-spec>] [--] [<path>...]`::\n+`update [--init] [--remote] [-N | --no-fetch] [--[no-]recommend-shallow] [-f | --force] [--checkout | --rebase | --merge] [--reference=<repository>] [--ref-storage-format=<format>] [--depth=<depth>] [--recursive] [--jobs <n>] [--[no-]single-branch] [--filter=<filter-spec>] [--] [<path>...]`::\n +\n --\n Update the registered submodules to match what the superproject\n@@ -188,7 +188,7 @@ submodule with the `--init` option.\n If `--recursive` is specified, this command will recurse into the\n registered submodules, and update any nested submodules within.\n \n-If `--ref-format <format>`  is specified, the ref storage format of newly\n+If `--ref-storage-format <format>`  is specified, the ref storage format of newly\n cloned submodules will be set accordingly.\n \n If `--filter <filter-spec>` is specified, the given partial clone filter will be\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 511fff9562..93be65efcd 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -725,7 +725,7 @@ static int checkout(int submodule_progress,\n \t\t}\n \n \t\tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tstrvec_pushf(&cmd.args, \"--ref-format=%s\",\n+\t\t\tstrvec_pushf(&cmd.args, \"--ref-storage-format=%s\",\n \t\t\t\t     ref_storage_format_to_name(ref_storage_format));\n \n \t\tif (filter_submodules && filter_options->choice)\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex e7cd3225fa..55eaaab38f 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -1941,7 +1941,7 @@ static int clone_submodule(const struct module_clone_data *clone_data,\n \t\t\t\t\t     item->string, NULL);\n \t\t}\n \t\tif (clone_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tstrvec_pushf(&cp.args, \"--ref-format=%s\",\n+\t\t\tstrvec_pushf(&cp.args, \"--ref-storage-format=%s\",\n \t\t\t\t     ref_storage_format_to_name(clone_data->ref_storage_format));\n \t\tif (clone_data->dissociate)\n \t\t\tstrvec_push(&cp.args, \"--dissociate\");\n@@ -2057,8 +2057,10 @@ static int module_clone(int argc, const char **argv, const char *prefix,\n \t\tOPT_STRING_LIST(0, \"reference\", &reference,\n \t\t\t   N_(\"repo\"),\n \t\t\t   N_(\"reference repository\")),\n-\t\tOPT_STRING(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n-\t\t\t   N_(\"specify the reference format to use\")),\n+\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format, N_(\"format\"),\n+\t\t\t   N_(\"specify the reference storage format to use\")),\n+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n+\t\t\t     N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n \t\tOPT_BOOL(0, \"dissociate\", &dissociate,\n \t\t\t   N_(\"use --reference only while cloning\")),\n \t\tOPT_INTEGER(0, \"depth\", &clone_data.depth,\n@@ -2357,7 +2359,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,\n \tif (suc->update_data->require_init)\n \t\tstrvec_push(&child->args, \"--require-init\");\n \tif (suc->update_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n-\t\tstrvec_pushf(&child->args, \"--ref-format=%s\",\n+\t\tstrvec_pushf(&child->args, \"--ref-storage-format=%s\",\n \t\t\t     ref_storage_format_to_name(suc->update_data->ref_storage_format));\n \tstrvec_pushl(&child->args, \"--path\", sub->path, NULL);\n \tstrvec_pushl(&child->args, \"--name\", sub->name, NULL);\n@@ -2801,7 +2803,7 @@ static void update_data_to_args(const struct update_data *update_data,\n \t\t\tstrvec_pushl(args, \"--reference\", item->string, NULL);\n \t}\n \tif (update_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)\n-\t\tstrvec_pushf(args, \"--ref-format=%s\",\n+\t\tstrvec_pushf(args, \"--ref-storage-format=%s\",\n \t\t\t     ref_storage_format_to_name(update_data->ref_storage_format));\n \tif (update_data->filter_options && update_data->filter_options->choice)\n \t\tstrvec_pushf(args, \"--filter=%s\",\n@@ -3010,8 +3012,10 @@ static int module_update(int argc, const char **argv, const char *prefix,\n \t\t\tSM_UPDATE_REBASE),\n \t\tOPT_STRING_LIST(0, \"reference\", &opt.references, N_(\"repo\"),\n \t\t\t   N_(\"reference repository\")),\n-\t\tOPT_STRING(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n-\t\t\t   N_(\"specify the reference format to use\")),\n+\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format, N_(\"format\"),\n+\t\t\t   N_(\"specify the reference storage format to use\")),\n+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n+\t\t\t     N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n \t\tOPT_BOOL(0, \"dissociate\", &opt.dissociate,\n \t\t\t   N_(\"use --reference only while cloning\")),\n \t\tOPT_INTEGER(0, \"depth\", &opt.depth,\n@@ -3659,8 +3663,10 @@ static int module_add(int argc, const char **argv, const char *prefix,\n \t\tOPT_BOOL(0, \"progress\", &progress, N_(\"force cloning progress\")),\n \t\tOPT_STRING(0, \"reference\", &add_data.reference_path, N_(\"repository\"),\n \t\t\t   N_(\"reference repository\")),\n-\t\tOPT_STRING(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n-\t\t\t   N_(\"specify the reference format to use\")),\n+\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format, N_(\"format\"),\n+\t\t\t   N_(\"specify the reference storage format to use\")),\n+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format, N_(\"format\"),\n+\t\t\t     N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n \t\tOPT_BOOL(0, \"dissociate\", &dissociate, N_(\"borrow the objects from reference repositories\")),\n \t\tOPT_STRING(0, \"name\", &add_data.sm_name, N_(\"name\"),\n \t\t\t   N_(\"sets the submodule's name to the given string \"\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 2999b31fad..8632194138 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -95,13 +95,13 @@ cmd_add()\n \t\t--reference=*)\n \t\t\treference=\"$1\"\n \t\t\t;;\n-\t\t--ref-format)\n+\t\t--ref-format|--ref-storage-format)\n \t\t\tcase \"$2\" in '') usage ;; esac\n-\t\t\tref_format=\"--ref-format=$2\"\n+\t\t\tref_storage_format=\"--ref-storage-format=$2\"\n \t\t\tshift\n \t\t\t;;\n-\t\t--ref-format=*)\n-\t\t\tref_format=\"$1\"\n+\t\t--ref-format=*|--ref-storage-format=*)\n+\t\t\tref_storage_format=\"$1\"\n \t\t\t;;\n \t\t--dissociate)\n \t\t\tdissociate=$1\n@@ -147,7 +147,7 @@ cmd_add()\n \t\t$progress \\\n \t\t${branch:+\"$branch\"} \\\n \t\t${reference:+\"$reference\"} \\\n-\t\t${ref_format:+\"$ref_format\"} \\\n+\t\t${ref_storage_format:+\"$ref_storage_format\"} \\\n \t\t$dissociate \\\n \t\t${name:+\"$name\"} \\\n \t\t${depth:+\"$depth\"} \\\n@@ -302,13 +302,13 @@ cmd_update()\n \t\t-r|--rebase)\n \t\t\trebase=$1\n \t\t\t;;\n-\t\t--ref-format)\n+\t\t--ref-format|--ref-storage-format)\n \t\t\tcase \"$2\" in '') usage ;; esac\n-\t\t\tref_format=\"--ref-format=$2\"\n+\t\t\tref_storage_format=\"--ref-storage-format=$2\"\n \t\t\tshift\n \t\t\t;;\n-\t\t--ref-format=*)\n-\t\t\tref_format=\"$1\"\n+\t\t--ref-format=*|--ref-storage-format=*)\n+\t\t\tref_storage_format=\"$1\"\n \t\t\t;;\n \t\t--reference)\n \t\t\tcase \"$2\" in '') usage ;; esac\n@@ -385,7 +385,7 @@ cmd_update()\n \t\t$rebase \\\n \t\t$merge \\\n \t\t$checkout \\\n-\t\t${ref_format:+\"$ref_format\"} \\\n+\t\t${ref_storage_format:+\"$ref_storage_format\"} \\\n \t\t${reference:+\"$reference\"} \\\n \t\t$dissociate \\\n \t\t${depth:+\"$depth\"} \\\ndiff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\nindex 9081401509..2ef85289b3 100755\n--- a/t/t7424-submodule-mixed-ref-formats.sh\n+++ b/t/t7424-submodule-mixed-ref-formats.sh\n@@ -44,7 +44,7 @@ test_expect_success 'add submodules with different ref storage format' '\n \ttest_commit -C submodule submodule-initial &&\n \tgit init upstream &&\n \ttest_ref_format upstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n-\tgit -C upstream submodule add --ref-format=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n+\tgit -C upstream submodule add --ref-storage-format=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n \ttest_ref_format upstream/submodule \"$OTHER_FORMAT\"\n '\n \n@@ -63,7 +63,7 @@ test_expect_success 'recursive clone propagates ref storage format' '\n \ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_FORMAT\" &&\n \n \t# The cloned repositories should use the other ref format that we have\n-\t# specified via `--ref-storage`. The option should propagate to cloned\n+\t# specified via `--ref-storage-format`. The option should propagate to cloned\n \t# submodules.\n \tgit clone --ref-storage-format=$OTHER_FORMAT --recurse-submodules \\\n \t\tupstream downstream &&\n@@ -82,7 +82,7 @@ test_expect_success 'clone submodules with different ref storage format' '\n \n \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n \ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n-\tgit -C downstream submodule update --init --ref-format=$OTHER_FORMAT &&\n+\tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\"\n '\n \n@@ -122,7 +122,7 @@ test_expect_success 'recursive pull with mixed formats' '\n \t# Clone the upstream repository such that the main repo and its\n \t# submodules have different formats.\n \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n-\tgit -C downstream submodule update --init --ref-format=$OTHER_FORMAT &&\n+\tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n \ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\" &&\n \n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552128","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-5-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 05/11] builtin/rev-parse: rename \"--show-ref-format\" to \"--show-ref-storage-format\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:39Z","receivedAt":"2026-09-07T11:20:24Z","isPatch":true,"body":"With the same reasoning as for git-init(1), rename \"--show-ref-format\"\nto \"--show-ref-storage-format\" and keep the old name as an alias.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/git-rev-parse.adoc       |  2 +-\n builtin/rev-parse.c                    |  2 +-\n contrib/completion/git-prompt.sh       |  2 +-\n t/perf/perf-lib.sh                     |  4 ++--\n t/t0001-init.sh                        | 36 +++++++++++++++++-----------------\n t/t0610-reftable-basics.sh             | 16 +++++++--------\n t/t1460-refs-migrate.sh                |  4 ++--\n t/t1500-rev-parse.sh                   |  8 ++++----\n t/t5601-clone.sh                       |  2 +-\n t/t7424-submodule-mixed-ref-formats.sh |  2 +-\n 10 files changed, 39 insertions(+), 39 deletions(-)\n\ndiff --git a/Documentation/git-rev-parse.adoc b/Documentation/git-rev-parse.adoc\nindex 5398691f3f..f794ceef22 100644\n--- a/Documentation/git-rev-parse.adoc\n+++ b/Documentation/git-rev-parse.adoc\n@@ -331,7 +331,7 @@ The following options are unaffected by `--path-format`:\n \trequested and no compatibility algorithm is enabled, prints an empty line. If\n \tnot specified, the default is \"storage\".\n \n---show-ref-format::\n+--show-ref-storage-format::\n \tShow the reference storage format used for the repository.\n \n \ndiff --git a/builtin/rev-parse.c b/builtin/rev-parse.c\nindex 43693454d5..ec33c19bdf 100644\n--- a/builtin/rev-parse.c\n+++ b/builtin/rev-parse.c\n@@ -1134,7 +1134,7 @@ int cmd_rev_parse(int argc,\n \t\t\t\t}\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tif (!strcmp(arg, \"--show-ref-format\")) {\n+\t\t\tif (!strcmp(arg, \"--show-ref-format\") || !strcmp(arg, \"--show-ref-storage-format\")) {\n \t\t\t\tputs(ref_storage_format_to_name(the_repository->ref_storage_format));\n \t\t\t\tcontinue;\n \t\t\t}\ndiff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh\nindex 6186c474ba..754a5edc9a 100644\n--- a/contrib/completion/git-prompt.sh\n+++ b/contrib/completion/git-prompt.sh\n@@ -466,7 +466,7 @@ __git_ps1 ()\n \n \tlocal repo_info rev_parse_exit_code\n \trepo_info=\"$(git rev-parse --git-dir --is-inside-git-dir \\\n-\t\t--is-bare-repository --is-inside-work-tree --show-ref-format \\\n+\t\t--is-bare-repository --is-inside-work-tree --show-ref-storage-format \\\n \t\t--short HEAD 2>/dev/null)\"\n \trev_parse_exit_code=\"$?\"\n \ndiff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh\nindex 3ce49fd423..846ecc35c3 100644\n--- a/t/perf/perf-lib.sh\n+++ b/t/perf/perf-lib.sh\n@@ -135,7 +135,7 @@ test_perf_create_repo_from () {\n \tsource_git=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --git-dir)\"\n \tobjects_dir=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --git-path objects)\"\n \tcommon_dir=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --git-common-dir)\"\n-\trefformat=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --show-ref-format)\"\n+\tref_storage_format=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --show-ref-storage-format)\"\n \tobjectformat=\"$(\"$MODERN_GIT\" -C \"$source\" rev-parse --show-object-format)\"\n \tmkdir -p \"$repo/.git\"\n \t(\n@@ -153,7 +153,7 @@ test_perf_create_repo_from () {\n \t) &&\n \t(\n \t\tcd \"$repo\" &&\n-\t\t\"$MODERN_GIT\" init -q --ref-storage-format=\"$refformat\" --object-format=\"$objectformat\" &&\n+\t\t\"$MODERN_GIT\" init -q --ref-storage-format=\"$ref_storage_format\" --object-format=\"$objectformat\" &&\n \t\ttest_perf_do_repo_symlink_config_ &&\n \t\tmv .git/hooks .git/hooks-disabled 2>/dev/null &&\n \t\tif test -f .git/index.lock\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex df9a2ff2da..b4f19d8077 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -657,7 +657,7 @@ test_expect_success 'init warns about invalid init.defaultRefFormat' '\n \tgit init repo 2>err &&\n \ttest_cmp expect err &&\n \n-\tgit -C repo rev-parse --show-ref-format >actual &&\n+\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \techo $GIT_DEFAULT_REF_FORMAT >expected &&\n \ttest_cmp expected actual\n '\n@@ -669,7 +669,7 @@ test_expect_success 'default ref format' '\n \t\tgit init refformat\n \t) &&\n \tgit version --build-options | sed -ne \"s/^default-ref-format: //p\" >expect &&\n-\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -692,7 +692,7 @@ do\n \t\ttest_cmp expect actual &&\n \n \t\techo $format >expect &&\n-\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n \n@@ -700,7 +700,7 @@ do\n \t\ttest_when_finished \"rm -rf refformat\" &&\n \t\tgit init --ref-storage-format=$format refformat &&\n \t\techo $format >expect &&\n-\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n \n@@ -713,7 +713,7 @@ do\n \t\t) &&\n \n \t\techo $format >expect &&\n-\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n \n@@ -721,16 +721,16 @@ do\n \t\ttest_when_finished \"rm -rf refformat\" &&\n \t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n \t\techo $format >expect &&\n-\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n \n \ttest_expect_success \"reinit repository with GIT_DEFAULT_REF_FORMAT=$format does not change format\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n \t\tgit init refformat &&\n-\t\tgit -C refformat rev-parse --show-ref-format >expect &&\n+\t\tgit -C refformat rev-parse --show-ref-storage-format >expect &&\n \t\tGIT_DEFAULT_REF_FORMAT=$format git init refformat &&\n-\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n done\n@@ -739,7 +739,7 @@ test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n \tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&\n \techo reftable >expect &&\n-\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -749,7 +749,7 @@ test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides init.defaultRefFormat\" '\n \n \tGIT_DEFAULT_REF_FORMAT=reftable git init refformat &&\n \techo reftable >expect &&\n-\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -761,7 +761,7 @@ test_expect_success \"init with feature.experimental=true\" '\n \t\tgit init refformat\n \t) &&\n \techo reftable >expect &&\n-\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -774,7 +774,7 @@ test_expect_success \"init.defaultRefFormat overrides feature.experimental=true\"\n \t\tgit init refformat\n \t) &&\n \techo files >expect &&\n-\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -783,7 +783,7 @@ test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides feature.experimental=true\n \ttest_config_global feature.experimental true &&\n \tGIT_DEFAULT_REF_FORMAT=files git init refformat &&\n \techo files >expect &&\n-\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -794,7 +794,7 @@ do\n \t\tgit init --ref-storage-format=$from_format refformat &&\n \t\tgit init --ref-storage-format=$from_format refformat &&\n \t\techo $from_format >expect &&\n-\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n \n@@ -814,7 +814,7 @@ do\n \t\t\ttest_must_fail git init --ref-storage-format=$to_format refformat 2>err &&\n \t\t\ttest_cmp expect err &&\n \t\t\techo $from_format >expect &&\n-\t\t\tgit -C refformat rev-parse --show-ref-format >actual &&\n+\t\t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\t\ttest_cmp expect actual\n \t\t'\n \tdone\n@@ -933,7 +933,7 @@ test_expect_success 'init with includeIf.onbranch condition' '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit -c includeIf.onbranch:main.path=nonexistent init repo &&\n \techo $GIT_DEFAULT_REF_FORMAT >expect &&\n-\tgit -C repo rev-parse --show-ref-format >actual &&\n+\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -942,7 +942,7 @@ test_expect_success 'init with includeIf.onbranch condition with existing direct\n \tmkdir repo &&\n \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n \techo $GIT_DEFAULT_REF_FORMAT >expect &&\n-\tgit -C repo rev-parse --show-ref-format >actual &&\n+\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -951,7 +951,7 @@ test_expect_success 're-init with includeIf.onbranch condition' '\n \tgit init repo &&\n \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n \techo $GIT_DEFAULT_REF_FORMAT >expect &&\n-\tgit -C repo rev-parse --show-ref-format >actual &&\n+\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh\nindex d325f17a14..b6db54430a 100755\n--- a/t/t0610-reftable-basics.sh\n+++ b/t/t0610-reftable-basics.sh\n@@ -27,7 +27,7 @@ test_expect_success 'init: creates basic reftable structures' '\n \ttest_path_is_dir repo/.git/reftable &&\n \ttest_path_is_file repo/.git/reftable/tables.list &&\n \techo reftable >expect &&\n-\tgit -C repo rev-parse --show-ref-format >actual &&\n+\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -38,7 +38,7 @@ test_expect_success 'init: sha256 object format via environment variable' '\n \tsha256\n \treftable\n \tEOF\n-\tgit -C repo rev-parse --show-object-format --show-ref-format >actual &&\n+\tgit -C repo rev-parse --show-object-format --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -49,7 +49,7 @@ test_expect_success 'init: sha256 object format via option' '\n \tsha256\n \treftable\n \tEOF\n-\tgit -C repo rev-parse --show-object-format --show-ref-format >actual &&\n+\tgit -C repo rev-parse --show-object-format --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -156,7 +156,7 @@ test_expect_success 'clone: can clone reftable repository' '\n \n \tgit clone repo cloned &&\n \techo reftable >expect &&\n-\tgit -C cloned rev-parse --show-ref-format >actual &&\n+\tgit -C cloned rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual &&\n \ttest_path_is_file cloned/file1\n '\n@@ -171,11 +171,11 @@ test_expect_success 'clone: can clone reffiles into reftable repository' '\n \tgit -C reftable rev-parse HEAD >actual &&\n \ttest_cmp expect actual &&\n \n-\tgit -C reftable rev-parse --show-ref-format >actual &&\n+\tgit -C reftable rev-parse --show-ref-storage-format >actual &&\n \techo reftable >expect &&\n \ttest_cmp expect actual &&\n \n-\tgit -C reffiles rev-parse --show-ref-format >actual &&\n+\tgit -C reffiles rev-parse --show-ref-storage-format >actual &&\n \techo files >expect &&\n \ttest_cmp expect actual\n '\n@@ -190,11 +190,11 @@ test_expect_success 'clone: can clone reftable into reffiles repository' '\n \tgit -C reffiles rev-parse HEAD >actual &&\n \ttest_cmp expect actual &&\n \n-\tgit -C reftable rev-parse --show-ref-format >actual &&\n+\tgit -C reftable rev-parse --show-ref-storage-format >actual &&\n \techo reftable >expect &&\n \ttest_cmp expect actual &&\n \n-\tgit -C reffiles rev-parse --show-ref-format >actual &&\n+\tgit -C reffiles rev-parse --show-ref-storage-format >actual &&\n \techo files >expect &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t1460-refs-migrate.sh b/t/t1460-refs-migrate.sh\nindex 204dd79b41..ecf6411288 100755\n--- a/t/t1460-refs-migrate.sh\n+++ b/t/t1460-refs-migrate.sh\n@@ -53,7 +53,7 @@ test_migration () {\n \t\ttest_cmp expect_logs actual_logs\n \tfi &&\n \n-\tgit -C \"$repo\" rev-parse --show-ref-format >actual &&\n+\tgit -C \"$repo\" rev-parse --show-ref-storage-format >actual &&\n \techo \"$format\" >expect &&\n \ttest_cmp expect actual\n }\n@@ -215,7 +215,7 @@ do\n \t\t\ttest_grep \"Finished dry-run migration of refs\" output &&\n \t\t\ttest_path_is_dir repo/.git/ref_migration.* &&\n \t\t\techo $from_format >expect &&\n-\t\t\tgit -C repo rev-parse --show-ref-format >actual &&\n+\t\t\tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \t\t\ttest_cmp expect actual\n \t\t'\n \ndiff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh\nindex 4174ca40c3..30bf8a4d0a 100755\n--- a/t/t1500-rev-parse.sh\n+++ b/t/t1500-rev-parse.sh\n@@ -241,19 +241,19 @@ test_expect_success RUST 'rev-parse --show-object-format in repo with compat mod\n \t)\n '\n \n-test_expect_success 'rev-parse --show-ref-format' '\n+test_expect_success 'rev-parse --show-ref-storage-format' '\n \ttest_detect_ref_format >expect &&\n-\tgit rev-parse --show-ref-format >actual &&\n+\tgit rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'rev-parse --show-ref-format with invalid storage' '\n+test_expect_success 'rev-parse --show-ref-storage-format with invalid storage' '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit init repo &&\n \t(\n \t\tcd repo &&\n \t\tgit config extensions.refstorage broken &&\n-\t\ttest_must_fail git rev-parse --show-ref-format 2>err &&\n+\t\ttest_must_fail git rev-parse --show-ref-storage-format 2>err &&\n \t\ttest_grep \"error: invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}broken${SQ}\" err\n \t)\n '\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 202d86bc83..06f6121f82 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -168,7 +168,7 @@ test_expect_success 'clone with files ref format' '\n \ttest_when_finished \"rm -rf ref-storage\" &&\n \tgit clone --ref-storage-format=files --mirror src ref-storage &&\n \techo files >expect &&\n-\tgit -C ref-storage rev-parse --show-ref-format >actual &&\n+\tgit -C ref-storage rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\nindex 2ef85289b3..9707744644 100755\n--- a/t/t7424-submodule-mixed-ref-formats.sh\n+++ b/t/t7424-submodule-mixed-ref-formats.sh\n@@ -6,7 +6,7 @@ test_description='submodules handle mixed ref storage formats'\n \n test_ref_format () {\n \techo \"$2\" >expect &&\n-\tgit -C \"$1\" rev-parse --show-ref-format >actual &&\n+\tgit -C \"$1\" rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n }\n \n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552129","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-6-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 06/11] help: rename \"default-ref-format\" to \"default-ref-storage-format\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:40Z","receivedAt":"2026-09-07T11:20:27Z","isPatch":true,"body":"When printing information about how specifically Git was built and what\ndefaults it has we also print the default ref storage format used when\ninitializing new repositories. This is to prepare for Git 3.0, where the\ndefault storage format will change from the \"files\" backend to the\n\"reftable\" backend.\n\nIn preceding commits we have adapted \"ref-format\" parameters to be\ncalled \"ref-storage-format\" instead to resolve some conceptual\nmismatches. The build information is now the only place where we still\nrefer to it as \"default-ref-format\".\n\nRename the field to \"default-ref-storage-format\" instead.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n help.c          | 2 +-\n t/t0001-init.sh | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/help.c b/help.c\nindex 46241492ce..1dd8391eeb 100644\n--- a/help.c\n+++ b/help.c\n@@ -824,7 +824,7 @@ void get_version_info(struct strbuf *buf, int show_build_options)\n \t\t\t    SHA1_UNSAFE_BACKEND);\n #endif\n \t\tstrbuf_addf(buf, \"SHA-256: %s\\n\", SHA256_BACKEND);\n-\t\tstrbuf_addf(buf, \"default-ref-format: %s\\n\",\n+\t\tstrbuf_addf(buf, \"default-ref-storage-format: %s\\n\",\n \t\t\t    ref_storage_format_to_name(REF_STORAGE_FORMAT_DEFAULT));\n \t\tstrbuf_addf(buf, \"default-hash: %s\\n\", hash_algos[GIT_HASH_DEFAULT].name);\n \t}\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex b4f19d8077..6f4431bed7 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -668,7 +668,7 @@ test_expect_success 'default ref format' '\n \t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n \t\tgit init refformat\n \t) &&\n-\tgit version --build-options | sed -ne \"s/^default-ref-format: //p\" >expect &&\n+\tgit version --build-options | sed -ne \"s/^default-ref-storage-format: //p\" >expect &&\n \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552130","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-7-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 07/11] refs: expose function to parse reference URIs","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:41Z","receivedAt":"2026-09-07T11:20:29Z","isPatch":true,"body":"In the next commit we're about to add more sites that want to parse a\nreference backends URI into a format and payload. Expose a new function\n`ref_storage_format_by_uri()` that enables this.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n refs.c  | 23 +++++++++++++++++++++++\n refs.h  |  4 ++++\n setup.c | 48 ++++++++++++------------------------------------\n 3 files changed, 39 insertions(+), 36 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex 92d5df5b71..951db56113 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -54,6 +54,29 @@ enum ref_storage_format ref_storage_format_by_name(const char *name)\n \treturn REF_STORAGE_FORMAT_UNKNOWN;\n }\n \n+enum ref_storage_format ref_storage_format_by_uri(const char *uri,\n+\t\t\t\t\t\t  char **payload)\n+{\n+\tenum ref_storage_format format;\n+\tconst char *schema_end;\n+\tchar *name;\n+\n+\tschema_end = strstr(uri, \"://\");\n+\tif (!schema_end) {\n+\t\tname = xstrdup(uri);\n+\t\tif (payload)\n+\t\t\t*payload = NULL;\n+\t} else {\n+\t\tname = xstrndup(uri, schema_end - uri);\n+\t\tif (payload)\n+\t\t\t*payload = xstrdup(schema_end + 3);\n+\t}\n+\n+\tformat = ref_storage_format_by_name(name);\n+\tfree(name);\n+\treturn format;\n+}\n+\n const char *ref_storage_format_to_name(enum ref_storage_format ref_storage_format)\n {\n \tconst struct ref_storage_be *be = find_ref_storage_backend(ref_storage_format);\ndiff --git a/refs.h b/refs.h\nindex 9979446d15..ee3b8a62ef 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -17,6 +17,10 @@ struct worktree;\n enum ref_storage_format ref_storage_format_by_name(const char *name);\n const char *ref_storage_format_to_name(enum ref_storage_format ref_storage_format);\n \n+/* Parse a reference storage URI in the format \"<format>[://<payload>]\". */\n+enum ref_storage_format ref_storage_format_by_uri(const char *uri,\n+\t\t\t\t\t\t  char **payload);\n+\n enum ref_transaction_error {\n \t/* Default error code */\n \tREF_TRANSACTION_ERROR_GENERIC = -1,\ndiff --git a/setup.c b/setup.c\nindex dfe05d9a03..3be7dac452 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -632,21 +632,6 @@ static enum extension_result handle_extension_v0(const char *var,\n \t\treturn EXTENSION_UNKNOWN;\n }\n \n-static void parse_reference_uri(const char *value, char **format,\n-\t\t\t\tchar **payload)\n-{\n-\tconst char *schema_end;\n-\n-\tschema_end = strstr(value, \"://\");\n-\tif (!schema_end) {\n-\t\t*format = xstrdup(value);\n-\t\t*payload = NULL;\n-\t} else {\n-\t\t*format = xstrndup(value, schema_end - value);\n-\t\t*payload = xstrdup_or_null(schema_end + 3);\n-\t}\n-}\n-\n /*\n  * Record any new extensions in this function.\n  */\n@@ -689,16 +674,13 @@ static enum extension_result handle_extension(const char *var,\n \t\treturn EXTENSION_OK;\n \t} else if (!strcmp(ext, \"refstorage\")) {\n \t\tunsigned int format;\n-\t\tchar *format_str;\n \n \t\tif (!value)\n \t\t\treturn config_error_nonbool(var);\n \n-\t\tparse_reference_uri(value, &format_str,\n-\t\t\t\t    &data->ref_storage_payload);\n-\n-\t\tformat = ref_storage_format_by_name(format_str);\n-\t\tfree(format_str);\n+\t\tFREE_AND_NULL(data->ref_storage_payload);\n+\t\tformat = ref_storage_format_by_uri(value,\n+\t\t\t\t\t\t   &data->ref_storage_payload);\n \n \t\tif (format == REF_STORAGE_FORMAT_UNKNOWN)\n \t\t\treturn error(_(\"invalid value for '%s': '%s'\"),\n@@ -2069,16 +2051,12 @@ const char *setup_git_directory_gently(struct repository *repo, int *nongit_ok)\n \t\t\t */\n \t\t\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n \t\t\tif (ref_backend_uri) {\n-\t\t\t\tchar *format;\n-\n-\t\t\t\tfree(discovery.format.ref_storage_payload);\n-\n-\t\t\t\tparse_reference_uri(ref_backend_uri, &format, &discovery.format.ref_storage_payload);\n-\t\t\t\tdiscovery.format.ref_storage_format = ref_storage_format_by_name(format);\n+\t\t\t\tFREE_AND_NULL(discovery.format.ref_storage_payload);\n+\t\t\t\tdiscovery.format.ref_storage_format =\n+\t\t\t\t\tref_storage_format_by_uri(ref_backend_uri,\n+\t\t\t\t\t\t\t\t  &discovery.format.ref_storage_payload);\n \t\t\t\tif (discovery.format.ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\t\t\tdie(_(\"unknown ref storage format: '%s'\"), format);\n-\n-\t\t\t\tfree(format);\n+\t\t\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n \t\t\t}\n \n \t\t\tif (apply_repository_format(repo, &discovery.format,\n@@ -2806,18 +2784,16 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n \n \tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n \tif (ref_backend_uri) {\n-\t\tchar *backend, *payload;\n \t\tenum ref_storage_format format;\n+\t\tchar *payload;\n \n-\t\tparse_reference_uri(ref_backend_uri, &backend, &payload);\n-\t\tformat = ref_storage_format_by_name(backend);\n+\t\tformat = ref_storage_format_by_uri(ref_backend_uri, &payload);\n \t\tif (format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tdie(_(\"unknown ref storage format: '%s'\"), backend);\n+\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n \n \t\trepo_fmt->ref_storage_format = format;\n+\t\tfree(repo_fmt->ref_storage_payload);\n \t\trepo_fmt->ref_storage_payload = payload;\n-\n-\t\tfree(backend);\n \t}\n }\n \n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552131","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-8-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 08/11] setup: refactor how we configure the ref storage format","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:42Z","receivedAt":"2026-09-07T11:20:33Z","isPatch":true,"body":"When (re)initializing a repository we need to figure out the ref storage\nformat that the repository ought to use. This logic is surprisingly\ncomplex, as we have grown a lot of different mechanisms over time to\nconfigure the format. Unfortunately, as a result of this organic growth,\nthe logic that configures the storage format has grown very complex.\n\nThe biggest culprit here is that we're mixing the logic that determines\nthe desired storage format with the logic that validates whether the end\nresult is sane. This leads to some repetitive code, and makes it very\neasy to forget validation for some of the branches.\n\nIn fact, the way we handle GIT_REFERENCE_BACKEND shows exactly one such\nedge case where we don't properly validate. When initializing a\nrepository with one storage format and then reinitializing it with the\nenvironment variable set to a different format then we'd corrupt the\nrepository because we silently change the format:\n\n    $ git init repo\n    $ git -C repo commit --allow-empty -m message\n    $ GIT_REFERENCE_BACKEND=reftable git -C repo init\n    fatal: could not open '.../refs/heads' for writing: Is a directory\n    $ git -C repo log\n    fatal: your current branch appears to be broken\n\nRefactor the code so that we clearly distinguish between these two\ndifferent concerns. This lets us clearly spell out the precedence order\nand makes the whole logic significantly easier to extend going forward.\n\nNote that the new logic intentionally changes the precedence order so\nthat \"GIT_REFERENCE_BACKEND\" is now overridden by the\n\"--ref-storage-format=\" command line option. This matches our usual\nprecedence order, where explicit command line arguments override\nenvironment variables.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n setup.c         | 103 +++++++++++++++++++++++++++++++++++---------------------\n t/t0001-init.sh |  12 ++++++-\n 2 files changed, 75 insertions(+), 40 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex 3be7dac452..38fa5e854c 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -2674,7 +2674,7 @@ static void separate_git_dir(struct repository *repo,\n \n struct default_format_config {\n \tint hash;\n-\tenum ref_storage_format ref_format;\n+\tenum ref_storage_format ref_storage_format;\n };\n \n static int read_default_format_config(const char *key, const char *value,\n@@ -2699,8 +2699,8 @@ static int read_default_format_config(const char *key, const char *value,\n \t\tret = git_config_string(&str, key, value);\n \t\tif (ret)\n \t\t\tgoto out;\n-\t\tcfg->ref_format = ref_storage_format_by_name(str);\n-\t\tif (cfg->ref_format == REF_STORAGE_FORMAT_UNKNOWN)\n+\t\tcfg->ref_storage_format = ref_storage_format_by_name(str);\n+\t\tif (cfg->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n \t\t\twarning(_(\"unknown ref storage format '%s'\"), str);\n \t\tgoto out;\n \t}\n@@ -2710,9 +2710,9 @@ static int read_default_format_config(const char *key, const char *value,\n \t * \"init.defaultRefFormat\" takes precedence over this setting.\n \t */\n \tif (!strcmp(key, \"feature.experimental\") &&\n-\t    cfg->ref_format == REF_STORAGE_FORMAT_UNKNOWN &&\n+\t    cfg->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN &&\n \t    git_config_bool(key, value)) {\n-\t\tcfg->ref_format = REF_STORAGE_FORMAT_REFTABLE;\n+\t\tcfg->ref_storage_format = REF_STORAGE_FORMAT_REFTABLE;\n \t\tret = 0;\n \t\tgoto out;\n \t}\n@@ -2724,18 +2724,18 @@ static int read_default_format_config(const char *key, const char *value,\n }\n \n static void repository_format_configure(struct repository_format *repo_fmt,\n-\t\t\t\t\tint hash, enum ref_storage_format ref_format)\n+\t\t\t\t\tint hash, enum ref_storage_format ref_storage_format)\n {\n \tstruct default_format_config cfg = {\n \t\t.hash = GIT_HASH_UNKNOWN,\n-\t\t.ref_format = REF_STORAGE_FORMAT_UNKNOWN,\n+\t\t.ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN,\n \t};\n \tstruct config_options opts = {\n \t\t.respect_includes = 1,\n \t\t.ignore_repo = 1,\n \t\t.ignore_worktree = 1,\n \t};\n-\tconst char *ref_backend_uri;\n+\tchar *ref_storage_payload = NULL;\n \tconst char *env;\n \n \tconfig_with_options(read_default_format_config, &cfg, NULL, NULL, &opts);\n@@ -2761,40 +2761,65 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n \t\trepo_fmt->hash_algo = cfg.hash;\n \t}\n \n-\tenv = getenv(\"GIT_DEFAULT_REF_FORMAT\");\n-\tif (repo_fmt->version >= 0 &&\n-\t    ref_format != REF_STORAGE_FORMAT_UNKNOWN &&\n-\t    ref_format != repo_fmt->ref_storage_format) {\n-\t\tdie(_(\"attempt to reinitialize repository with different reference storage format\"));\n-\t} else if (ref_format != REF_STORAGE_FORMAT_UNKNOWN) {\n-\t\trepo_fmt->ref_storage_format = ref_format;\n-\t} else if (env) {\n-\t\tref_format = ref_storage_format_by_name(env);\n-\t\tif (ref_format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tdie(_(\"unknown ref storage format '%s'\"), env);\n-\t\tif (repo_fmt->version < 0 ||\n-\t\t    repo_fmt->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\trepo_fmt->ref_storage_format = ref_format;\n-\t} else if (cfg.ref_format != REF_STORAGE_FORMAT_UNKNOWN) {\n-\t\trepo_fmt->ref_storage_format = cfg.ref_format;\n+\t/*\n+\t * We have the following order of preference when configuring the ref\n+\t * storage format:\n+\t *\n+\t *   1. Explicit override via the command line, like in `git init\n+\t *      --ref-storage-format=`.\n+\t *\n+\t *   2. Explicit override via the environment with\n+\t *      GIT_REFERENCE_BACKEND.\n+\t *\n+\t *   3. Existing repository format. All the subsequent sources only\n+\t *      kick in when there is no repository yet.\n+\t *\n+\t *   4. The default ref storage format for new repositories as\n+\t *      configured via \"GIT_DEFAULT_REF_FORMAT\".\n+\t *\n+\t *   5. The default ref storage format for new repositories as\n+\t *      configured via \"init.defaultRefFormat\"\n+\t *\n+\t *   6. Otherwise, we fall back to the default ref storage format\n+\t *      compiled into Git.\n+\t */\n+\tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n+\t\t/* nothing to do */\n+\t} else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) {\n+\t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n+\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n+\t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n+\t\t\t    GIT_REFERENCE_BACKEND_ENVIRONMENT, env);\n+\t} else if (repo_fmt->version >= 0) {\n+\t\tref_storage_format = repo_fmt->ref_storage_format;\n+\t\tref_storage_payload = xstrdup_or_null(repo_fmt->ref_storage_payload);\n+\t} else if ((env = getenv(\"GIT_DEFAULT_REF_FORMAT\"))) {\n+\t\tref_storage_format = ref_storage_format_by_name(env);\n+\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n+\t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n+\t\t\t    \"GIT_DEFAULT_REF_FORMAT\", env);\n+\t} else if (cfg.ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n+\t\tref_storage_format = cfg.ref_storage_format;\n \t} else {\n-\t\trepo_fmt->ref_storage_format = REF_STORAGE_FORMAT_DEFAULT;\n+\t\tref_storage_format = REF_STORAGE_FORMAT_DEFAULT;\n \t}\n \n-\n-\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n-\tif (ref_backend_uri) {\n-\t\tenum ref_storage_format format;\n-\t\tchar *payload;\n-\n-\t\tformat = ref_storage_format_by_uri(ref_backend_uri, &payload);\n-\t\tif (format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n-\n-\t\trepo_fmt->ref_storage_format = format;\n-\t\tfree(repo_fmt->ref_storage_payload);\n-\t\trepo_fmt->ref_storage_payload = payload;\n-\t}\n+\t/*\n+\t * If we have a preexisting repository we need to verify that its\n+\t * current ref storage format does not change.\n+\t */\n+\tif (repo_fmt->version >= 0) {\n+\t\tif (ref_storage_format != repo_fmt->ref_storage_format)\n+\t\t\tdie(_(\"attempt to reinitialize repository with different reference storage format\"));\n+\t\tif ((ref_storage_payload || repo_fmt->ref_storage_payload) &&\n+\t\t    strcmp(ref_storage_payload ? ref_storage_payload : \"\",\n+\t\t\t   repo_fmt->ref_storage_payload ? repo_fmt->ref_storage_payload : \"\"))\n+\t\t\tdie(_(\"attempt to reinitialize repository with different reference storage payload\"));\n+\t}\n+\n+\tfree(repo_fmt->ref_storage_payload);\n+\trepo_fmt->ref_storage_format = ref_storage_format;\n+\trepo_fmt->ref_storage_payload = ref_storage_payload;\n }\n \n int init_db(struct repository *repo,\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 6f4431bed7..ca44dfc1ce 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -643,12 +643,22 @@ test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage with unknown back\n test_expect_success 'init with GIT_DEFAULT_REF_FORMAT=garbage' '\n \ttest_when_finished \"rm -rf refformat\" &&\n \tcat >expect <<-EOF &&\n-\tfatal: unknown ref storage format ${SQ}garbage${SQ}\n+\tfatal: unknown ref storage format specified via GIT_DEFAULT_REF_FORMAT: ${SQ}garbage${SQ}\n \tEOF\n \ttest_must_fail env GIT_DEFAULT_REF_FORMAT=garbage git init refformat 2>err &&\n \ttest_cmp expect err\n '\n \n+test_expect_success 'GIT_REFERENCE_BACKEND refuses to reinitialize with different storage format' '\n+\ttest_when_finished \"rm -rf refbackend\" &&\n+\tgit init --ref-storage-format=files refbackend &&\n+\tcat >expect <<-EOF &&\n+\tfatal: attempt to reinitialize repository with different reference storage format\n+\tEOF\n+\ttest_must_fail env GIT_REFERENCE_BACKEND=reftable git init refbackend 2>err &&\n+\ttest_cmp expect err\n+'\n+\n test_expect_success 'init warns about invalid init.defaultRefFormat' '\n \ttest_when_finished \"rm -rf repo\" &&\n \ttest_config_global init.defaultRefFormat garbage &&\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552132","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-9-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 09/11] setup: rename ref storage format environment variables","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:43Z","receivedAt":"2026-09-07T11:20:36Z","isPatch":true,"body":"With the same reasoning as for git-init(1), rename the environment\nvariables GIT_REFERENCE_BACKEND and GIT_DEFAULT_REF_FORMAT to\nGIT_REF_STORAGE_FORMAT and GIT_DEFAULT_REF_STORAGE_FORMAT, respectively.\nThe old names are kept as an alias to retain compatibility.\n\nWhile at it, fix indentation for `GIT_REF_STORAGE_FORMAT` docs to use\ntabs instead of spaces.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/config/init.adoc         |  2 +-\n Documentation/git.adoc                 | 12 ++++----\n environment.h                          |  1 +\n setup.c                                | 21 ++++++++------\n t/t0001-init.sh                        | 50 +++++++++++++++++-----------------\n t/t1419-exclude-refs.sh                | 16 +++++------\n t/t1423-ref-backend.sh                 | 18 ++++++------\n t/t7424-submodule-mixed-ref-formats.sh | 14 +++++-----\n t/test-lib.sh                          |  8 +++---\n 9 files changed, 74 insertions(+), 68 deletions(-)\n\ndiff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc\nindex a048f0bddc..f82fcf25e6 100644\n--- a/Documentation/config/init.adoc\n+++ b/Documentation/config/init.adoc\n@@ -16,7 +16,7 @@ endif::[]\n `init.defaultRefFormat`::\n \tAllows overriding the default ref storage format for new repositories.\n \tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n-\toption and the `GIT_DEFAULT_REF_FORMAT` environment variable take\n+\toption and the `GIT_DEFAULT_REF_STORAGE_FORMAT` environment variable take\n \tprecedence over this config.\n \n init.defaultSubmodulePathConfig::\ndiff --git a/Documentation/git.adoc b/Documentation/git.adoc\nindex 23ba65656e..d78e2b5c10 100644\n--- a/Documentation/git.adoc\n+++ b/Documentation/git.adoc\n@@ -590,15 +590,15 @@ double-quotes and respecting backslash escapes. E.g., the value\n \tis always used. The default is \"sha1\".\n \tSee `--object-format` in linkgit:git-init[1].\n \n-`GIT_DEFAULT_REF_FORMAT`::\n-\tIf this variable is set, the default reference backend format for new\n+`GIT_DEFAULT_REF_STORAGE_FORMAT`::\n+\tIf this variable is set, the default ref storage format for new\n \trepositories will be set to this value. The default is \"files\".\n \tSee `--ref-storage-format` in linkgit:git-init[1].\n \n-`GIT_REFERENCE_BACKEND`::\n-    Specify which reference backend to be used along with its URI.\n-    See `extensions.refStorage` option in linkgit:git-config[1] for more\n-    details. Overrides the config variable when used.\n+`GIT_REF_STORAGE_FORMAT`::\n+\tSpecify which ref storage format to use along with its URI.\n+\tSee `extensions.refStorage` option in linkgit:git-config[1] for more\n+\tdetails. Overrides the config variable when used.\n \n Git Commits\n ~~~~~~~~~~~\ndiff --git a/environment.h b/environment.h\nindex e7ec5b0437..4bd8f08dee 100644\n--- a/environment.h\n+++ b/environment.h\n@@ -44,6 +44,7 @@\n #define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT \"GIT_TEXTDOMAINDIR\"\n #define GIT_ATTR_SOURCE_ENVIRONMENT \"GIT_ATTR_SOURCE\"\n #define GIT_REFERENCE_BACKEND_ENVIRONMENT \"GIT_REFERENCE_BACKEND\"\n+#define GIT_REF_STORAGE_FORMAT_ENVIRONMENT \"GIT_REF_STORAGE_FORMAT\"\n \n /*\n  * Environment variable used to propagate the --no-advice global option to the\ndiff --git a/setup.c b/setup.c\nindex 38fa5e854c..e2bb04410f 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -2049,7 +2049,9 @@ const char *setup_git_directory_gently(struct repository *repo, int *nongit_ok)\n \t\t\t * The env variable should override the repository config\n \t\t\t * for 'extensions.refStorage'.\n \t\t\t */\n-\t\t\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n+\t\t\tref_backend_uri = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT);\n+\t\t\tif (!ref_backend_uri)\n+\t\t\t\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n \t\t\tif (ref_backend_uri) {\n \t\t\t\tFREE_AND_NULL(discovery.format.ref_storage_payload);\n \t\t\t\tdiscovery.format.ref_storage_format =\n@@ -2768,14 +2770,15 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n \t *   1. Explicit override via the command line, like in `git init\n \t *      --ref-storage-format=`.\n \t *\n-\t *   2. Explicit override via the environment with\n-\t *      GIT_REFERENCE_BACKEND.\n+\t *   2. Explicit override via the environment with \"GIT_REF_STORAGE_FORMAT\"\n+\t *      or its deprecated equivalent \"GIT_REFERENCE_BACKEND\".\n \t *\n \t *   3. Existing repository format. All the subsequent sources only\n \t *      kick in when there is no repository yet.\n \t *\n \t *   4. The default ref storage format for new repositories as\n-\t *      configured via \"GIT_DEFAULT_REF_FORMAT\".\n+\t *      configured via \"GIT_DEFAULT_REF_STORAGE_FORMAT\" or its\n+\t *      deprecated equivalent \"GIT_DEFAULT_REF_FORMAT\".\n \t *\n \t *   5. The default ref storage format for new repositories as\n \t *      configured via \"init.defaultRefFormat\"\n@@ -2785,19 +2788,21 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n \t */\n \tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n \t\t/* nothing to do */\n-\t} else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) {\n+\t} else if (((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT)) ||\n+\t\t    (env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT)))) {\n \t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n \t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n-\t\t\t    GIT_REFERENCE_BACKEND_ENVIRONMENT, env);\n+\t\t\t    GIT_REF_STORAGE_FORMAT_ENVIRONMENT, env);\n \t} else if (repo_fmt->version >= 0) {\n \t\tref_storage_format = repo_fmt->ref_storage_format;\n \t\tref_storage_payload = xstrdup_or_null(repo_fmt->ref_storage_payload);\n-\t} else if ((env = getenv(\"GIT_DEFAULT_REF_FORMAT\"))) {\n+\t} else if (((env = getenv(\"GIT_DEFAULT_REF_STORAGE_FORMAT\")) ||\n+\t\t    (env = getenv(\"GIT_DEFAULT_REF_FORMAT\")))) {\n \t\tref_storage_format = ref_storage_format_by_name(env);\n \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n \t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n-\t\t\t    \"GIT_DEFAULT_REF_FORMAT\", env);\n+\t\t\t    \"GIT_DEFAULT_REF_STORAGE_FORMAT\", env);\n \t} else if (cfg.ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n \t\tref_storage_format = cfg.ref_storage_format;\n \t} else {\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex ca44dfc1ce..af9a7ba958 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -640,22 +640,22 @@ test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage with unknown back\n \ttest_grep \"invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}garbage${SQ}\" err\n '\n \n-test_expect_success 'init with GIT_DEFAULT_REF_FORMAT=garbage' '\n+test_expect_success 'init with GIT_DEFAULT_REF_STORAGE_FORMAT=garbage' '\n \ttest_when_finished \"rm -rf refformat\" &&\n \tcat >expect <<-EOF &&\n-\tfatal: unknown ref storage format specified via GIT_DEFAULT_REF_FORMAT: ${SQ}garbage${SQ}\n+\tfatal: unknown ref storage format specified via GIT_DEFAULT_REF_STORAGE_FORMAT: ${SQ}garbage${SQ}\n \tEOF\n-\ttest_must_fail env GIT_DEFAULT_REF_FORMAT=garbage git init refformat 2>err &&\n+\ttest_must_fail env GIT_DEFAULT_REF_STORAGE_FORMAT=garbage git init refformat 2>err &&\n \ttest_cmp expect err\n '\n \n-test_expect_success 'GIT_REFERENCE_BACKEND refuses to reinitialize with different storage format' '\n+test_expect_success 'GIT_REF_STORAGE_FORMAT refuses to reinitialize with different storage format' '\n \ttest_when_finished \"rm -rf refbackend\" &&\n \tgit init --ref-storage-format=files refbackend &&\n \tcat >expect <<-EOF &&\n \tfatal: attempt to reinitialize repository with different reference storage format\n \tEOF\n-\ttest_must_fail env GIT_REFERENCE_BACKEND=reftable git init refbackend 2>err &&\n+\ttest_must_fail env GIT_REF_STORAGE_FORMAT=reftable git init refbackend 2>err &&\n \ttest_cmp expect err\n '\n \n@@ -668,14 +668,14 @@ test_expect_success 'init warns about invalid init.defaultRefFormat' '\n \ttest_cmp expect err &&\n \n \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n-\techo $GIT_DEFAULT_REF_FORMAT >expected &&\n+\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expected &&\n \ttest_cmp expected actual\n '\n \n test_expect_success 'default ref format' '\n \ttest_when_finished \"rm -rf refformat\" &&\n \t(\n-\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n+\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n \t\tgit init refformat\n \t) &&\n \tgit version --build-options | sed -ne \"s/^default-ref-storage-format: //p\" >expect &&\n@@ -686,9 +686,9 @@ test_expect_success 'default ref format' '\n backends=\"files reftable\"\n for format in $backends\n do\n-\ttest_expect_success DEFAULT_REPO_FORMAT \"init with GIT_DEFAULT_REF_FORMAT=$format\" '\n+\ttest_expect_success DEFAULT_REPO_FORMAT \"init with GIT_DEFAULT_REF_STORAGE_FORMAT=$format\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n-\t\tGIT_DEFAULT_REF_FORMAT=$format git init refformat &&\n+\t\tGIT_DEFAULT_REF_STORAGE_FORMAT=$format git init refformat &&\n \n \t\tif test $format = files\n \t\tthen\n@@ -718,7 +718,7 @@ do\n \t\ttest_when_finished \"rm -rf refformat\" &&\n \t\ttest_config_global init.defaultRefFormat $format &&\n \t\t(\n-\t\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n+\t\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n \t\t\tgit init refformat\n \t\t) &&\n \n@@ -727,37 +727,37 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"--ref-storage-format=$format overrides GIT_DEFAULT_REF_FORMAT\" '\n+\ttest_expect_success \"--ref-storage-format=$format overrides GIT_DEFAULT_REF_STORAGE_FORMAT\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n-\t\tGIT_DEFAULT_REF_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n+\t\tGIT_DEFAULT_REF_STORAGE_FORMAT=garbage git init --ref-storage-format=$format refformat &&\n \t\techo $format >expect &&\n \t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"reinit repository with GIT_DEFAULT_REF_FORMAT=$format does not change format\" '\n+\ttest_expect_success \"reinit repository with GIT_DEFAULT_REF_STORAGE_FORMAT=$format does not change format\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n \t\tgit init refformat &&\n \t\tgit -C refformat rev-parse --show-ref-storage-format >expect &&\n-\t\tGIT_DEFAULT_REF_FORMAT=$format git init refformat &&\n+\t\tGIT_DEFAULT_REF_STORAGE_FORMAT=$format git init refformat &&\n \t\tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \t\ttest_cmp expect actual\n \t'\n done\n \n-test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_FORMAT\" '\n+test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_STORAGE_FOMAT\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n-\tGIT_DEFAULT_REF_FORMAT=files git init --ref-storage-format=reftable refformat &&\n+\tGIT_DEFAULT_REF_STORAGE_FORMAT=files git init --ref-storage-format=reftable refformat &&\n \techo reftable >expect &&\n \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides init.defaultRefFormat\" '\n+test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefFormat\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n \ttest_config_global init.defaultRefFormat files &&\n \n-\tGIT_DEFAULT_REF_FORMAT=reftable git init refformat &&\n+\tGIT_DEFAULT_REF_STORAGE_FORMAT=reftable git init refformat &&\n \techo reftable >expect &&\n \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n@@ -767,7 +767,7 @@ test_expect_success \"init with feature.experimental=true\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n \ttest_config_global feature.experimental true &&\n \t(\n-\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n+\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n \t\tgit init refformat\n \t) &&\n \techo reftable >expect &&\n@@ -780,7 +780,7 @@ test_expect_success \"init.defaultRefFormat overrides feature.experimental=true\"\n \ttest_config_global feature.experimental true &&\n \ttest_config_global init.defaultRefFormat files &&\n \t(\n-\t\tsane_unset GIT_DEFAULT_REF_FORMAT &&\n+\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n \t\tgit init refformat\n \t) &&\n \techo files >expect &&\n@@ -788,10 +788,10 @@ test_expect_success \"init.defaultRefFormat overrides feature.experimental=true\"\n \ttest_cmp expect actual\n '\n \n-test_expect_success \"GIT_DEFAULT_REF_FORMAT= overrides feature.experimental=true\" '\n+test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides feature.experimental=true\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n \ttest_config_global feature.experimental true &&\n-\tGIT_DEFAULT_REF_FORMAT=files git init refformat &&\n+\tGIT_DEFAULT_REF_STORAGE_FORMAT=files git init refformat &&\n \techo files >expect &&\n \tgit -C refformat rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n@@ -942,7 +942,7 @@ test_expect_success 'branch -m with the initial branch' '\n test_expect_success 'init with includeIf.onbranch condition' '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit -c includeIf.onbranch:main.path=nonexistent init repo &&\n-\techo $GIT_DEFAULT_REF_FORMAT >expect &&\n+\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&\n \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n@@ -951,7 +951,7 @@ test_expect_success 'init with includeIf.onbranch condition with existing direct\n \ttest_when_finished \"rm -rf repo\" &&\n \tmkdir repo &&\n \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n-\techo $GIT_DEFAULT_REF_FORMAT >expect &&\n+\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&\n \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\n@@ -960,7 +960,7 @@ test_expect_success 're-init with includeIf.onbranch condition' '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit init repo &&\n \tgit -c includeIf.onbranch:nonexistent.path=/does/not/exist init repo &&\n-\techo $GIT_DEFAULT_REF_FORMAT >expect &&\n+\techo $GIT_DEFAULT_REF_STORAGE_FORMAT >expect &&\n \tgit -C repo rev-parse --show-ref-storage-format >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t1419-exclude-refs.sh b/t/t1419-exclude-refs.sh\nindex 04797aee59..50237a5aeb 100755\n--- a/t/t1419-exclude-refs.sh\n+++ b/t/t1419-exclude-refs.sh\n@@ -21,13 +21,13 @@ assert_jumps () {\n \tlocal nr=\"$1\"\n \tlocal trace=\"$2\"\n \n-\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n+\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n \tfiles)\n \t\tgrep -q \"name:jumps_made value:$nr$\" $trace;;\n \treftable)\n \t\tgrep -q \"name:reseeks_made value:$nr$\" $trace;;\n \t*)\n-\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n+\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n \tesac\n }\n \n@@ -93,13 +93,13 @@ test_expect_success 'adjacent, non-overlapping excluded regions' '\n \tfor_each_ref refs/heads/foo refs/heads/quux >expect &&\n \n \ttest_cmp expect actual &&\n-\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n+\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n \tfiles)\n \t\tassert_jumps 1 perf;;\n \treftable)\n \t\tassert_jumps 2 perf;;\n \t*)\n-\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n+\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n \tesac\n '\n \n@@ -125,13 +125,13 @@ test_expect_success 'several overlapping excluded regions' '\n \tfor_each_ref refs/heads/quux >expect &&\n \n \ttest_cmp expect actual &&\n-\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n+\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n \tfiles)\n \t\tassert_jumps 1 perf;;\n \treftable)\n \t\tassert_jumps 3 perf;;\n \t*)\n-\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n+\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n \tesac\n '\n \n@@ -141,13 +141,13 @@ test_expect_success 'unordered excludes' '\n \tfor_each_ref refs/heads/bar refs/heads/quux >expect &&\n \n \ttest_cmp expect actual &&\n-\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n+\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n \tfiles)\n \t\tassert_jumps 1 perf;;\n \treftable)\n \t\tassert_jumps 2 perf;;\n \t*)\n-\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n+\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n \tesac\n '\n \ndiff --git a/t/t1423-ref-backend.sh b/t/t1423-ref-backend.sh\nindex ab119a6568..525b2a19b4 100755\n--- a/t/t1423-ref-backend.sh\n+++ b/t/t1423-ref-backend.sh\n@@ -12,7 +12,7 @@ test_description='Test reference backend URIs'\n #   <uri> is the new URI to be set for the ref storage.\n #   <cmd> is the git subcommand to be run in the repository.\n #   <via> if 'config', set the backend via the 'extensions.refStorage' config.\n-#         if 'env', set the backend via the 'GIT_REFERENCE_BACKEND' env.\n+#         if 'env', set the backend via the 'GIT_REF_STORAGE_FORMAT' env.\n run_with_uri () {\n \trepo=$1 &&\n \tbackend=$2 &&\n@@ -23,7 +23,7 @@ run_with_uri () {\n \tgit -C \"$repo\" config set core.repositoryformatversion 1 &&\n \tif test \"$via\" = \"env\"\n \tthen\n-\t\ttest_env GIT_REFERENCE_BACKEND=\"$uri\" git -C \"$repo\" $cmd\n+\t\ttest_env GIT_REF_STORAGE_FORMAT=\"$uri\" git -C \"$repo\" $cmd\n \telif test \"$via\" = \"config\"\n \tthen\n \t\tgit -C \"$repo\" config set extensions.refStorage \"$uri\" &&\n@@ -40,7 +40,7 @@ run_with_uri () {\n #   <backend> is the original ref storage of the repo.\n #   <uri> is the new URI to be set for the ref storage.\n #   <via> if 'config', set the backend via the 'extensions.refStorage' config.\n-#         if 'env', set the backend via the 'GIT_REFERENCE_BACKEND' env.\n+#         if 'env', set the backend via the 'GIT_REF_STORAGE_FORMAT' env.\n #   <err_msg> (optional) if set, check if 'git-refs(1)' failed with the provided msg.\n test_refs_backend () {\n \trepo=$1 &&\n@@ -54,7 +54,7 @@ test_refs_backend () {\n \tthen\n \t\tif test \"$via\" = \"env\"\n \t\tthen\n-\t\t\ttest_env GIT_REFERENCE_BACKEND=\"$uri\" test_must_fail git -C \"$repo\" refs list 2>err\n+\t\t\ttest_env GIT_REF_STORAGE_FORMAT=\"$uri\" test_must_fail git -C \"$repo\" refs list 2>err\n \t\telif test \"$via\" = \"config\"\n \t\tthen\n \t\t\tgit -C \"$repo\" config set extensions.refStorage \"$uri\" &&\n@@ -83,7 +83,7 @@ verify_files_exist () {\n \ttest_cmp expect $gitdir/HEAD\n \n \t# verify that backend specific files exist.\n-\tcase \"$GIT_DEFAULT_REF_FORMAT\" in\n+\tcase \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n \tfiles)\n \t\ttest_path_is_dir $refdir/refs/heads &&\n \t\ttest_path_is_file $refdir/HEAD;;\n@@ -91,7 +91,7 @@ verify_files_exist () {\n \t\ttest_path_is_dir $refdir/reftable &&\n \t\ttest_path_is_file $refdir/reftable/tables.list;;\n \t*)\n-\t\tBUG \"unhandled ref format $GIT_DEFAULT_REF_FORMAT\";;\n+\t\tBUG \"unhandled ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\";;\n \tesac\n }\n \n@@ -210,7 +210,7 @@ do\n \ttest_expect_success \"migrating repository to $to_format with alternate refs directory\" '\n \t\ttest_when_finished \"rm -rf repo refdir\" &&\n \t\tmkdir refdir &&\n-\t\tGIT_REFERENCE_BACKEND=\"${from_format}://$(pwd)/refdir\" git init repo &&\n+\t\tGIT_REF_STORAGE_FORMAT=\"${from_format}://$(pwd)/refdir\" git init repo &&\n \t\t(\n \t\t\tcd repo &&\n \n@@ -235,7 +235,7 @@ test_expect_success 'initializing repository with alt ref directory' '\n \ttest_when_finished \"rm -rf repo refdir\" &&\n \tmkdir refdir &&\n \tBACKEND=\"$(test_detect_ref_format)://$(pwd)/refdir\" &&\n-\tGIT_REFERENCE_BACKEND=$BACKEND git init repo &&\n+\tGIT_REF_STORAGE_FORMAT=$BACKEND git init repo &&\n \tverify_files_exist repo/.git refdir &&\n \t(\n \t\tcd repo &&\n@@ -264,7 +264,7 @@ test_expect_success 'cloning repository with alt ref directory' '\n \ttest_commit -C source 3 &&\n \n \tBACKEND=\"$(test_detect_ref_format)://$(pwd)/refdir\" &&\n-\tGIT_REFERENCE_BACKEND=$BACKEND git clone source repo &&\n+\tGIT_REF_STORAGE_FORMAT=$BACKEND git clone source repo &&\n \n \tgit -C repo config get extensions.refstorage >actual &&\n \techo $BACKEND >expect &&\ndiff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\nindex 9707744644..197c02bcf0 100755\n--- a/t/t7424-submodule-mixed-ref-formats.sh\n+++ b/t/t7424-submodule-mixed-ref-formats.sh\n@@ -12,7 +12,7 @@ test_ref_format () {\n \n for OTHER_FORMAT in files reftable\n do\n-\tif test \"$OTHER_FORMAT\" = \"$GIT_DEFAULT_REF_FORMAT\"\n+\tif test \"$OTHER_FORMAT\" = \"$GIT_DEFAULT_REF_STORAGE_FORMAT\"\n \tthen\n \t\tcontinue\n \tfi\n@@ -43,7 +43,7 @@ test_expect_success 'add submodules with different ref storage format' '\n \tgit init submodule &&\n \ttest_commit -C submodule submodule-initial &&\n \tgit init upstream &&\n-\ttest_ref_format upstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n+\ttest_ref_format upstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n \tgit -C upstream submodule add --ref-storage-format=\"$OTHER_FORMAT\" \"file://$(pwd)/submodule\" &&\n \ttest_ref_format upstream/submodule \"$OTHER_FORMAT\"\n '\n@@ -59,8 +59,8 @@ test_expect_success 'recursive clone propagates ref storage format' '\n \n \t# The upstream repository and its submodule should be using the default\n \t# ref format.\n-\ttest_ref_format upstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n-\ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_FORMAT\" &&\n+\ttest_ref_format upstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n+\ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n \n \t# The cloned repositories should use the other ref format that we have\n \t# specified via `--ref-storage-format`. The option should propagate to cloned\n@@ -81,7 +81,7 @@ test_expect_success 'clone submodules with different ref storage format' '\n \tgit -C upstream commit -m \"upstream submodule\" &&\n \n \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n-\ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n+\ttest_ref_format downstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n \tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\"\n '\n@@ -98,7 +98,7 @@ test_expect_success 'status with mixed submodule ref storages' '\n \n \t# The main repository should use the default ref format now, whereas\n \t# the submodule should use the other format.\n-\ttest_ref_format main \"$GIT_DEFAULT_REF_FORMAT\" &&\n+\ttest_ref_format main \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n \ttest_ref_format main/submodule \"$OTHER_FORMAT\" &&\n \n \tcat >expect <<-EOF &&\n@@ -123,7 +123,7 @@ test_expect_success 'recursive pull with mixed formats' '\n \t# submodules have different formats.\n \tgit clone --no-recurse-submodules \"file://$(pwd)/upstream\" downstream &&\n \tgit -C downstream submodule update --init --ref-storage-format=$OTHER_FORMAT &&\n-\ttest_ref_format downstream \"$GIT_DEFAULT_REF_FORMAT\" &&\n+\ttest_ref_format downstream \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" &&\n \ttest_ref_format downstream/submodule \"$OTHER_FORMAT\" &&\n \n \t# Update the upstream submodule as well as the owning repository such\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 1f0505e412..60a2179a0a 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -575,8 +575,8 @@ export EDITOR\n GIT_TEST_BUILTIN_HASH=$(\"$GIT_BINARY\" version --build-options | sed -ne 's/^default-hash: //p')\n GIT_DEFAULT_HASH=\"${GIT_TEST_DEFAULT_HASH:-$GIT_TEST_BUILTIN_HASH}\"\n export GIT_DEFAULT_HASH\n-GIT_DEFAULT_REF_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n-export GIT_DEFAULT_REF_FORMAT\n+GIT_DEFAULT_REF_STORAGE_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n+export GIT_DEFAULT_REF_STORAGE_FORMAT\n \n # Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output\n GIT_TRACE_BARE=1\n@@ -1752,13 +1752,13 @@ parisc* | hppa*)\n \t;;\n esac\n \n-case \"$GIT_DEFAULT_REF_FORMAT\" in\n+case \"$GIT_DEFAULT_REF_STORAGE_FORMAT\" in\n files)\n \ttest_set_prereq REFFILES;;\n reftable)\n \ttest_set_prereq REFTABLE;;\n *)\n-\techo 2>&1 \"error: unknown ref format $GIT_DEFAULT_REF_FORMAT\"\n+\techo 2>&1 \"error: unknown ref storage format $GIT_DEFAULT_REF_STORAGE_FORMAT\"\n \texit 1\n \t;;\n esac\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552133","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-10-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 10/11] setup: rename \"init.defaultRefFormat\" to \"init.defaultRefStorageFormat\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:44Z","receivedAt":"2026-09-07T11:20:37Z","isPatch":true,"body":"With the same reasoning as for git-init(1), rename the\n\"init.defaultRefFormat\" config option to \"init.defaultRefStorageFormat\"\nand keep the old name as an alias.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/BreakingChanges.adoc |  2 +-\n Documentation/config/feature.adoc  |  2 +-\n Documentation/config/init.adoc     |  2 +-\n setup.c                            |  8 +++++---\n t/t0001-init.sh                    | 16 ++++++++--------\n 5 files changed, 16 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc\nindex 73bb939359..c2cef3f528 100644\n--- a/Documentation/BreakingChanges.adoc\n+++ b/Documentation/BreakingChanges.adoc\n@@ -156,7 +156,7 @@ Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zombino.com>,\n      \"packed-refs\" file.\n +\n Users that get immediate benefit from the \"reftable\" backend could continue to\n-opt-in to the \"reftable\" format manually by setting the \"init.defaultRefFormat\"\n+opt-in to the \"reftable\" format manually by setting the \"init.defaultRefStorageFormat\"\n config. But defaults matter, and we think that overall users will have a better\n experience with less platform-specific quirks when they use the new backend by\n default.\ndiff --git a/Documentation/config/feature.adoc b/Documentation/config/feature.adoc\nindex 924f5ff4e3..e258770591 100644\n--- a/Documentation/config/feature.adoc\n+++ b/Documentation/config/feature.adoc\n@@ -25,7 +25,7 @@ reusing objects from multiple packs instead of just one.\n significantly smaller in the presence of certain filename collisions with Git's\n default name-hash.\n +\n-* `init.defaultRefFormat=reftable` causes newly initialized repositories to use\n+* `init.defaultRefStorageFormat=reftable` causes newly initialized repositories to use\n the reftable format for storing references. This new format solves issues with\n case-insensitive filesystems, compresses better and performs significantly\n better with many use cases. Refer to Documentation/technical/reftable.adoc for\ndiff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc\nindex f82fcf25e6..10d6aba3ff 100644\n--- a/Documentation/config/init.adoc\n+++ b/Documentation/config/init.adoc\n@@ -13,7 +13,7 @@ endif::[]\n \t`--object-format=` in linkgit:git-init[1]. Both the command line option\n \tand the `GIT_DEFAULT_HASH` environment variable take precedence over\n \tthis config.\n-`init.defaultRefFormat`::\n+`init.defaultRefStorageFormat`::\n \tAllows overriding the default ref storage format for new repositories.\n \tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n \toption and the `GIT_DEFAULT_REF_STORAGE_FORMAT` environment variable take\ndiff --git a/setup.c b/setup.c\nindex e2bb04410f..52ad0f417d 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -2697,7 +2697,8 @@ static int read_default_format_config(const char *key, const char *value,\n \t\tgoto out;\n \t}\n \n-\tif (!strcmp(key, \"init.defaultrefformat\")) {\n+\tif (!strcmp(key, \"init.defaultrefstorageformat\") ||\n+\t    !strcmp(key, \"init.defaultrefformat\")) {\n \t\tret = git_config_string(&str, key, value);\n \t\tif (ret)\n \t\t\tgoto out;\n@@ -2709,7 +2710,7 @@ static int read_default_format_config(const char *key, const char *value,\n \n \t/*\n \t * Enable the reftable format when \"features.experimental\" is enabled.\n-\t * \"init.defaultRefFormat\" takes precedence over this setting.\n+\t * \"init.defaultRefStorageFormat\" takes precedence over this setting.\n \t */\n \tif (!strcmp(key, \"feature.experimental\") &&\n \t    cfg->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN &&\n@@ -2781,7 +2782,8 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n \t *      deprecated equivalent \"GIT_DEFAULT_REF_FORMAT\".\n \t *\n \t *   5. The default ref storage format for new repositories as\n-\t *      configured via \"init.defaultRefFormat\"\n+\t *      configured via \"init.defaultRefStorageFormat\" or its deprecated\n+\t *      equivalent \"init.defaultRefFormat\".\n \t *\n \t *   6. Otherwise, we fall back to the default ref storage format\n \t *      compiled into Git.\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex af9a7ba958..fe5bc3d3e1 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -659,9 +659,9 @@ test_expect_success 'GIT_REF_STORAGE_FORMAT refuses to reinitialize with differe\n \ttest_cmp expect err\n '\n \n-test_expect_success 'init warns about invalid init.defaultRefFormat' '\n+test_expect_success 'init warns about invalid init.defaultRefStorageFormat' '\n \ttest_when_finished \"rm -rf repo\" &&\n-\ttest_config_global init.defaultRefFormat garbage &&\n+\ttest_config_global init.defaultRefStorageFormat garbage &&\n \n \techo \"warning: unknown ref storage format ${SQ}garbage${SQ}\" >expect &&\n \tgit init repo 2>err &&\n@@ -714,9 +714,9 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"init with init.defaultRefFormat=$format\" '\n+\ttest_expect_success \"init with init.defaultRefStorageFormat=$format\" '\n \t\ttest_when_finished \"rm -rf refformat\" &&\n-\t\ttest_config_global init.defaultRefFormat $format &&\n+\t\ttest_config_global init.defaultRefStorageFormat $format &&\n \t\t(\n \t\t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n \t\t\tgit init refformat\n@@ -753,9 +753,9 @@ test_expect_success \"--ref-storage-format= overrides GIT_DEFAULT_REF_STORAGE_FOM\n \ttest_cmp expect actual\n '\n \n-test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefFormat\" '\n+test_expect_success \"GIT_DEFAULT_REF_STORAGE_FORMAT= overrides init.defaultRefStorageFormat\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n-\ttest_config_global init.defaultRefFormat files &&\n+\ttest_config_global init.defaultRefStorageFormat files &&\n \n \tGIT_DEFAULT_REF_STORAGE_FORMAT=reftable git init refformat &&\n \techo reftable >expect &&\n@@ -775,10 +775,10 @@ test_expect_success \"init with feature.experimental=true\" '\n \ttest_cmp expect actual\n '\n \n-test_expect_success \"init.defaultRefFormat overrides feature.experimental=true\" '\n+test_expect_success \"init.defaultRefStorageFormat overrides feature.experimental=true\" '\n \ttest_when_finished \"rm -rf refformat\" &&\n \ttest_config_global feature.experimental true &&\n-\ttest_config_global init.defaultRefFormat files &&\n+\ttest_config_global init.defaultRefStorageFormat files &&\n \t(\n \t\tsane_unset GIT_DEFAULT_REF_STORAGE_FORMAT &&\n \t\tgit init refformat\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552134","messageId":"20260907-b4-pks-unify-ref-storage-format-v2-11-6733c90ca5b0@pks.im","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-0-6733c90ca5b0@pks.im","subject":"[PATCH v2 11/11] setup: allow \"git init --ref-storage-format=\" to specify a payload","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-07T11:18:45Z","receivedAt":"2026-09-07T11:20:40Z","isPatch":true,"body":"Reference storage backends can be configured with a payload via the\n\"extensions.refStorage\" config key and the \"GIT_REF_STORAGE_FORMAT\"\nenvironment variable, both of which accept a URI in the format\n\"<format>://<payload>\". The payload may contain backend-specific\ninformation, for example an alternate refs directory or which database\nreferences should be stored in.\n\nThe `--ref-storage-format=` option of git-init(1) and git-clone(1) does\nnot know about payloads though: its value is parsed as a plain format\nname, so backends that require a payload cannot be conveniently set up\nat initialization time via the command line.\n\nTeach the option to accept the same URI syntax. Also, document the\noptional payloads for both the \"files\" and \"reftable\" backends.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n Documentation/git-init.adoc           |  5 ++++-\n Documentation/ref-storage-format.adoc |  8 ++++++--\n builtin/clone.c                       | 14 +++++++-------\n builtin/init-db.c                     | 17 +++++------------\n setup.c                               | 16 +++++++++++-----\n setup.h                               |  2 +-\n t/t0001-init.sh                       |  2 +-\n t/t1423-ref-backend.sh                | 30 ++++++++++++++++++++++++++++++\n 8 files changed, 65 insertions(+), 29 deletions(-)\n\ndiff --git a/Documentation/git-init.adoc b/Documentation/git-init.adoc\nindex 7e407d3ef1..e078369ed7 100644\n--- a/Documentation/git-init.adoc\n+++ b/Documentation/git-init.adoc\n@@ -58,7 +58,10 @@ values are `sha1` and (if enabled) `sha256`.  `sha1` is the default.\n include::object-format-disclaimer.adoc[]\n \n `--ref-storage-format=<format>`::\n-Specify the given ref storage _<format>_ for the repository. The valid values are:\n+Specify the given ref storage _<format>_ for the repository. Backends that\n+require additional configuration accept a payload in the form\n+`<format>://<payload>`, for example a connection string identifying the\n+database that shall store the references. The valid values are:\n +\n include::ref-storage-format.adoc[]\n \ndiff --git a/Documentation/ref-storage-format.adoc b/Documentation/ref-storage-format.adoc\nindex c5e29ec831..21d62557b7 100644\n--- a/Documentation/ref-storage-format.adoc\n+++ b/Documentation/ref-storage-format.adoc\n@@ -1,8 +1,12 @@\n-`files`;; for loose files with packed-refs.\n+`files[://<path>]`;; for loose files with packed-refs. The optional payload can\n+be specified to change the root directory where references are created. A\n+relative path will be resolved relative to the repository's common directory.\n ifndef::with-breaking-changes[]\n \tThis is the default.\n endif::with-breaking-changes[]\n-`reftable`;; for the reftable format.\n+`reftable[://<path>]`;; for the reftable format. The optional payload can\n+be specified to change the root directory where references are created. A\n+relative path will be resolved relative to the repository's common directory.\n ifdef::with-breaking-changes[]\n \tThis is the default.\n endif::with-breaking-changes[]\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 93be65efcd..808a40c4fb 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -901,7 +901,7 @@ int cmd_clone(int argc,\n \tchar *option_origin = NULL;\n \tstruct string_list option_not = STRING_LIST_INIT_NODUP;\n \tconst char *real_git_dir = NULL;\n-\tconst char *ref_storage_format_str = NULL;\n+\tconst char *ref_storage_format_uri = NULL;\n \tconst char *option_upload_pack = \"git-upload-pack\";\n \tint option_progress = -1;\n \tint option_sparse_checkout = 0;\n@@ -981,9 +981,9 @@ int cmd_clone(int argc,\n \t\t\t N_(\"any cloned submodules will be shallow\")),\n \t\tOPT_STRING(0, \"separate-git-dir\", &real_git_dir, N_(\"gitdir\"),\n \t\t\t   N_(\"separate git dir from working tree\")),\n-\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_uri, N_(\"format\"),\n \t\t\t   N_(\"specify the reference storage format to use\")),\n-\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_uri, N_(\"format\"),\n \t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n \t\tOPT_STRING_LIST('c', \"config\", &option_config, N_(\"key=value\"),\n \t\t\t\tN_(\"set config inside the new repository\")),\n@@ -1029,10 +1029,10 @@ int cmd_clone(int argc,\n \tif (option_single_branch == -1)\n \t\toption_single_branch = deepen ? 1 : 0;\n \n-\tif (ref_storage_format_str) {\n-\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n+\tif (ref_storage_format_uri) {\n+\t\tref_storage_format = ref_storage_format_by_uri(ref_storage_format_uri, NULL);\n \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n+\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_uri);\n \t}\n \n \tif (option_mirror) {\n@@ -1188,7 +1188,7 @@ int cmd_clone(int argc,\n \t * their on-disk data structures.\n \t */\n \tinit_db(the_repository, git_dir, real_git_dir, work_tree, option_template,\n-\t\tGIT_HASH_UNKNOWN, ref_storage_format, NULL,\n+\t\tGIT_HASH_UNKNOWN, ref_storage_format_uri, NULL,\n \t\tdo_not_override_repo_unix_permissions,\n \t\tINIT_DB_QUIET | INIT_DB_SKIP_REFDB);\n \ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 63f33154c0..48074cb235 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -83,10 +83,9 @@ int cmd_init_db(int argc,\n \tunsigned int flags = 0;\n \tint bare = startup_info->force_bare_repository ? 1 : -1;\n \tconst char *object_format = NULL;\n-\tconst char *ref_storage_format_str = NULL;\n+\tconst char *ref_storage_format_uri = NULL;\n \tconst char *initial_branch = NULL;\n \tint hash_algo = GIT_HASH_UNKNOWN;\n-\tenum ref_storage_format ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;\n \tint init_shared_repository = -1;\n \tconst struct option init_db_options[] = {\n \t\tOPT_STRING(0, \"template\", &template_dir, N_(\"template-directory\"),\n@@ -109,9 +108,9 @@ int cmd_init_db(int argc,\n \t\t\t   N_(\"override the name of the initial branch\")),\n \t\tOPT_STRING(0, \"object-format\", &object_format, N_(\"hash\"),\n \t\t\t   N_(\"specify the hash algorithm to use\")),\n-\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_uri, N_(\"format\"),\n \t\t\t   N_(\"specify the reference storage format to use\")),\n-\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n+\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_uri, N_(\"format\"),\n \t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n \t\tOPT_END()\n \t};\n@@ -175,12 +174,6 @@ int cmd_init_db(int argc,\n \t\t\tdie(_(\"unknown hash algorithm '%s'\"), object_format);\n \t}\n \n-\tif (ref_storage_format_str) {\n-\t\tref_storage_format = ref_storage_format_by_name(ref_storage_format_str);\n-\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n-\t\t\tdie(_(\"unknown ref storage format '%s'\"), ref_storage_format_str);\n-\t}\n-\n \tif (init_shared_repository != -1)\n \t\trepo_settings_set_shared_repository(the_repository, init_shared_repository);\n \n@@ -251,8 +244,8 @@ int cmd_init_db(int argc,\n \n \tflags |= INIT_DB_EXIST_OK;\n \tret = init_db(the_repository, git_dir, real_git_dir, work_tree,\n-\t\t      template_dir, hash_algo, ref_storage_format, initial_branch,\n-\t\t      init_shared_repository, flags);\n+\t\t      template_dir, hash_algo, ref_storage_format_uri,\n+\t\t      initial_branch, init_shared_repository, flags);\n \n \tfree(template_dir_to_free);\n \tfree(real_git_dir_to_free);\ndiff --git a/setup.c b/setup.c\nindex 52ad0f417d..4ece4725a5 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -2727,7 +2727,8 @@ static int read_default_format_config(const char *key, const char *value,\n }\n \n static void repository_format_configure(struct repository_format *repo_fmt,\n-\t\t\t\t\tint hash, enum ref_storage_format ref_storage_format)\n+\t\t\t\t\tint hash,\n+\t\t\t\t\tconst char *ref_storage_format_uri)\n {\n \tstruct default_format_config cfg = {\n \t\t.hash = GIT_HASH_UNKNOWN,\n@@ -2738,6 +2739,7 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n \t\t.ignore_repo = 1,\n \t\t.ignore_worktree = 1,\n \t};\n+\tenum ref_storage_format ref_storage_format;\n \tchar *ref_storage_payload = NULL;\n \tconst char *env;\n \n@@ -2788,8 +2790,12 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n \t *   6. Otherwise, we fall back to the default ref storage format\n \t *      compiled into Git.\n \t */\n-\tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n-\t\t/* nothing to do */\n+\tif (ref_storage_format_uri) {\n+\t\tref_storage_format = ref_storage_format_by_uri(ref_storage_format_uri,\n+\t\t\t\t\t\t\t       &ref_storage_payload);\n+\t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n+\t\t\tdie(_(\"unknown ref storage format specified via command line: '%s'\"),\n+\t\t\t    ref_storage_format_uri);\n \t} else if (((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT)) ||\n \t\t    (env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT)))) {\n \t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n@@ -2834,7 +2840,7 @@ int init_db(struct repository *repo,\n \t    const char *real_git_dir,\n \t    const char *worktree,\n \t    const char *template_dir, int hash,\n-\t    enum ref_storage_format ref_storage_format,\n+\t    const char *ref_storage_format_uri,\n \t    const char *initial_branch,\n \t    int init_shared_repository, unsigned int flags)\n {\n@@ -2871,7 +2877,7 @@ int init_db(struct repository *repo,\n \t * is an attempt to reinitialize new repository with an old tool.\n \t */\n \tread_and_verify_repository_format(&repo_fmt, repo_get_git_dir(repo), NULL);\n-\trepository_format_configure(&repo_fmt, hash, ref_storage_format);\n+\trepository_format_configure(&repo_fmt, hash, ref_storage_format_uri);\n \tif (apply_repository_format(repo, &repo_fmt, APPLY_REPOSITORY_FORMAT_HONOR_ENV, &err) < 0)\n \t\tdie(\"%s\", err.buf);\n \ndiff --git a/setup.h b/setup.h\nindex 763fd384e8..f04d2984b4 100644\n--- a/setup.h\n+++ b/setup.h\n@@ -265,7 +265,7 @@ int init_db(struct repository *repo,\n \t    const char *real_git_dir,\n \t    const char *worktree,\n \t    const char *template_dir, int hash_algo,\n-\t    enum ref_storage_format ref_storage_format,\n+\t    const char *ref_storage_format_uri,\n \t    const char *initial_branch, int init_shared_repository,\n \t    unsigned int flags);\n void initialize_repository_version(struct repository *repo,\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex fe5bc3d3e1..f1d227f271 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -833,7 +833,7 @@ done\n test_expect_success 'init with --ref-storage-format=garbage' '\n \ttest_when_finished \"rm -rf refformat\" &&\n \tcat >expect <<-EOF &&\n-\tfatal: unknown ref storage format ${SQ}garbage${SQ}\n+\tfatal: unknown ref storage format specified via command line: ${SQ}garbage${SQ}\n \tEOF\n \ttest_must_fail git init --ref-storage-format=garbage refformat 2>err &&\n \ttest_cmp expect err\ndiff --git a/t/t1423-ref-backend.sh b/t/t1423-ref-backend.sh\nindex 525b2a19b4..ee2bb66b99 100755\n--- a/t/t1423-ref-backend.sh\n+++ b/t/t1423-ref-backend.sh\n@@ -254,6 +254,36 @@ test_expect_success 'initializing repository with alt ref directory' '\n \t)\n '\n \n+test_expect_success 'initializing repository with --ref-storage-format and payload' '\n+\ttest_when_finished \"rm -rf repo refdir\" &&\n+\tmkdir refdir &&\n+\tBACKEND=\"$(test_detect_ref_format)://$(pwd)/refdir\" &&\n+\tgit init --ref-storage-format=\"$BACKEND\" repo &&\n+\tverify_files_exist repo/.git refdir &&\n+\n+\tgit -C repo config get extensions.refstorage >actual &&\n+\techo $BACKEND >expect &&\n+\ttest_cmp expect actual &&\n+\n+\ttest_commit -C repo 1 &&\n+\tgit -C repo refs list >out &&\n+\ttest_grep \"refs/tags/1\" out &&\n+\n+\t# Reinitializing the repository is fine when not specifying any format.\n+\tgit -C repo init &&\n+\t# Reinitializing with the same backend is fine, too.\n+\tgit -C repo init --ref-storage-format=\"$BACKEND\" &&\n+\t# Reinitializing without a payload should fail.\n+\ttest_must_fail git -C repo init --ref-storage-format=\"$(test_detect_ref_format)\" 2>err &&\n+\ttest_grep \"attempt to reinitialize repository with different reference storage payload\" err &&\n+\t# Reinitializing with a different payload should fail, too.\n+\ttest_must_fail git -C repo init --ref-storage-format=\"$(test_detect_ref_format)://$(pwd)/other\" 2>err &&\n+\ttest_grep \"attempt to reinitialize repository with different reference storage payload\" err &&\n+\n+\tgit -C repo config get extensions.refstorage >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'cloning repository with alt ref directory' '\n \ttest_when_finished \"rm -rf source repo refdir\" &&\n \tmkdir refdir &&\n\n-- \n2.55.0.1007.g17ff1f9808.dirty\n\n"},{"id":"552192","messageId":"aacc3fcb-43e6-4f62-b083-5fbabaa9f494@gmail.com","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-1-6733c90ca5b0@pks.im","subject":"Re: [PATCH v2 01/11] builtin/init: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-08T09:01:22Z","receivedAt":"2026-09-08T09:01:31Z","isPatch":true,"body":"On 9/7/26 16:48, Patrick Steinhardt wrote:\n\n> Instead, this and subsequent patches will fix the mess by consistently\n> referring to the ref storage format as such throughout all options,\n> environment variables and config settings. This new name much more\n> closely indicates that it is about how we store data and finally brings\n> consistency into this area. We will keep the old names working of course\n> for the sake of backwards compatibility.\n> \n\nJust a doubt regarding the old option. At the moment, the patch appears \nto introduce the new name alongside the old name. Do we not plan on \ndeprecating the old one and issue a warning to users when it is used so \nthat we could eventually retire it at some point?\n\n> ---\n>   Documentation/config/init.adoc         |  2 +-\n>   Documentation/git-init.adoc            |  4 ++--\n>   Documentation/git.adoc                 |  2 +-\n>   builtin/init-db.c                      | 16 ++++++++-------\n>   t/perf/p1401-ref-store-tombstones.sh   |  4 ++--\n>   t/perf/perf-lib.sh                     |  2 +-\n>   t/t0001-init.sh                        | 24 +++++++++++------------\n>   t/t0610-reftable-basics.sh             | 14 ++++++-------\n>   t/t0611-reftable-httpd.sh              |  2 +-\n>   t/t1400-update-ref.sh                  |  2 +-\n>   t/t1423-ref-backend.sh                 |  6 +++---\n>   t/t1460-refs-migrate.sh                | 36 +++++++++++++++++-----------------\n>   t/t1900-repo-info.sh                   |  6 +++---\n>   t/t5510-fetch.sh                       |  8 ++++----\n>   t/t7424-submodule-mixed-ref-formats.sh |  2 +-\n>   15 files changed, 66 insertions(+), 64 deletions(-)\n> \n> diff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc\n> index 7b4abdaf8b..a048f0bddc 100644\n> --- a/Documentation/config/init.adoc\n> +++ b/Documentation/config/init.adoc\n> @@ -15,7 +15,7 @@ endif::[]\n>   \tthis config.\n>   `init.defaultRefFormat`::\n>   \tAllows overriding the default ref storage format for new repositories.\n> -\tSee `--ref-format=` in linkgit:git-init[1]. Both the command line\n> +\tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n>   \toption and the `GIT_DEFAULT_REF_FORMAT` environment variable take\n>   \tprecedence over this config.\n\nRelevant only if we are deprecating the old option: we need to mention \nthat the old one is deprecated in the documentation so that users are \naware of the same.\n\n> diff --git a/Documentation/git-init.adoc b/Documentation/git-init.adoc\n> index bab99b9b47..7e407d3ef1 100644\n> --- a/Documentation/git-init.adoc\n> +++ b/Documentation/git-init.adoc\n> @@ -11,7 +11,7 @@ SYNOPSIS\n>   [synopsis]\n>   git init [-q | --quiet] [--bare] [--template=<template-directory>]\n>   \t [--separate-git-dir <git-dir>] [--object-format=<format>]\n> -\t [--ref-format=<format>]\n> +\t [--ref-storage-format=<format>]\n>   \t [-b <branch-name> | --initial-branch=<branch-name>]\n>   \t [--shared[=<permissions>]] [<directory>]\n>   \n> @@ -57,7 +57,7 @@ values are `sha1` and (if enabled) `sha256`.  `sha1` is the default.\n>   +\n>   include::object-format-disclaimer.adoc[]\n>   \n> -`--ref-format=<format>`::\n> +`--ref-storage-format=<format>`::\n>   Specify the given ref storage _<format>_ for the repository. The valid values are:\n>   +\n>   include::ref-storage-format.adoc[]\n> diff --git a/Documentation/git.adoc b/Documentation/git.adoc\n> index 8a5cdd3b3d..23ba65656e 100644\n> --- a/Documentation/git.adoc\n> +++ b/Documentation/git.adoc\n> @@ -593,7 +593,7 @@ double-quotes and respecting backslash escapes. E.g., the value\n>   `GIT_DEFAULT_REF_FORMAT`::\n>   \tIf this variable is set, the default reference backend format for new\n>   \trepositories will be set to this value. The default is \"files\".\n> -\tSee `--ref-format` in linkgit:git-init[1].\n> +\tSee `--ref-storage-format` in linkgit:git-init[1].\n>   \n>   `GIT_REFERENCE_BACKEND`::\n>       Specify which reference backend to be used along with its URI.\n> diff --git a/builtin/init-db.c b/builtin/init-db.c\n> index e96b1283b7..63f33154c0 100644\n> --- a/builtin/init-db.c\n> +++ b/builtin/init-db.c\n> @@ -57,7 +57,7 @@ static int shared_callback(const struct option *opt, const char *arg, int unset)\n>   static const char *const init_db_usage[] = {\n>   \tN_(\"git init [-q | --quiet] [--bare] [--template=<template-directory>]\\n\"\n>   \t   \"         [--separate-git-dir <git-dir>] [--object-format=<format>]\\n\"\n> -\t   \"         [--ref-format=<format>]\\n\"\n> +\t   \"         [--ref-storage-format=<format>]\\n\"\n>   \t   \"         [-b <branch-name> | --initial-branch=<branch-name>]\\n\"\n>   \t   \"         [--shared[=<permissions>]] [<directory>]\"),\n>   \tNULL\n> @@ -83,7 +83,7 @@ int cmd_init_db(int argc,\n>   \tunsigned int flags = 0;\n>   \tint bare = startup_info->force_bare_repository ? 1 : -1;\n>   \tconst char *object_format = NULL;\n> -\tconst char *ref_format = NULL;\n> +\tconst char *ref_storage_format_str = NULL;\n>   \tconst char *initial_branch = NULL;\n>   \tint hash_algo = GIT_HASH_UNKNOWN;\n>   \tenum ref_storage_format ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;\n> @@ -109,8 +109,10 @@ int cmd_init_db(int argc,\n>   \t\t\t   N_(\"override the name of the initial branch\")),\n>   \t\tOPT_STRING(0, \"object-format\", &object_format, N_(\"hash\"),\n>   \t\t\t   N_(\"specify the hash algorithm to use\")),\n> -\t\tOPT_STRING(0, \"ref-format\", &ref_format, N_(\"format\"),\n> -\t\t\t   N_(\"specify the reference format to use\")),\n> +\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n> +\t\t\t   N_(\"specify the reference storage format to use\")),\n> +\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n> +\t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n\nRelevant only if we are deprecating the old option: We could change the \ndescription of the old option to convey that it is deprecated so that it \ncould be easily distinguished by anyone reading through. I suggest this \nby noting a similar pattern in `builtin/name-rev.c` for the `--stdin` \nargument.\n\nIf we don't plan to deprecate, I suppose we could use OPT_ALIAS to \nclarify that `ref-format` is an alias of `ref-storage-format` similar to \nhow `recursive` is marked as an alias of `recurse-submodules` in \n`builtin/clone.c`.\n\n> diff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\n> index 559713b607..1ca245c732 100755\n> --- a/t/t7424-submodule-mixed-ref-formats.sh\n> +++ b/t/t7424-submodule-mixed-ref-formats.sh\n> @@ -31,7 +31,7 @@ test_expect_success 'add existing repository with different ref storage format'\n>   \t(\n>   \t\tcd parent &&\n>   \t\ttest_commit parent &&\n> -\t\tgit init --ref-format=$OTHER_FORMAT submodule &&\n> +\t\tgit init --ref-storage-format=$OTHER_FORMAT submodule &&\n>   \t\ttest_commit -C submodule submodule &&\n>   \t\tgit submodule add ./submodule\n>   \t)\n> \n\nRest of the patch looks fine to me.\n\n--\nSivaraam\n\n"},{"id":"552194","messageId":"1cbb335d-ed50-4e6d-9d11-bd09de1bcee3@gmail.com","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-2-6733c90ca5b0@pks.im","subject":"Re: [PATCH v2 02/11] builtin/clone: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-08T09:21:37Z","receivedAt":"2026-09-08T09:21:41Z","isPatch":true,"body":"On 9/7/26 16:48, Patrick Steinhardt wrote:\n> diff --git a/builtin/clone.c b/builtin/clone.c\n> index 5b25cca510..511fff9562 100644\n> --- a/builtin/clone.c\n> +++ b/builtin/clone.c\n> @@ -901,7 +901,7 @@ int cmd_clone(int argc,\n>   \tchar *option_origin = NULL;\n>   \tstruct string_list option_not = STRING_LIST_INIT_NODUP;\n>   \tconst char *real_git_dir = NULL;\n> -\tconst char *ref_format = NULL;\n> +\tconst char *ref_storage_format_str = NULL;\n>   \tconst char *option_upload_pack = \"git-upload-pack\";\n>   \tint option_progress = -1;\n>   \tint option_sparse_checkout = 0;\n> @@ -981,8 +981,10 @@ int cmd_clone(int argc,\n>   \t\t\t N_(\"any cloned submodules will be shallow\")),\n>   \t\tOPT_STRING(0, \"separate-git-dir\", &real_git_dir, N_(\"gitdir\"),\n>   \t\t\t   N_(\"separate git dir from working tree\")),\n> -\t\tOPT_STRING(0, \"ref-format\", &ref_format, N_(\"format\"),\n> -\t\t\t   N_(\"specify the reference format to use\")),\n> +\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n> +\t\t\t   N_(\"specify the reference storage format to use\")),\n> +\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n> +\t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n>   \t\tOPT_STRING_LIST('c', \"config\", &option_config, N_(\"key=value\"),\n>   \t\t\t\tN_(\"set config inside the new repository\")),\n>   \t\tOPT_STRING_LIST(0, \"server-option\", &server_options,\n\nDitto here about either deprecating / using OPT_ALIAS.\n\n\n> diff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\n> index 1ca245c732..5eaf689d74 100755\n> --- a/t/t7424-submodule-mixed-ref-formats.sh\n> +++ b/t/t7424-submodule-mixed-ref-formats.sh\n> @@ -63,9 +63,9 @@ test_expect_success 'recursive clone propagates ref storage format' '\n>   \ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_FORMAT\" &&\n>   \n>   \t# The cloned repositories should use the other ref format that we have\n> -\t# specified via `--ref-format`. The option should propagate to cloned\n> +\t# specified via `--ref-storage`. The option should propagate to cloned\n\ns/ref-storage/ref-storage-format\n\nRest of the patch looks fine to me.\n\n--\nSivaraam\n\n"},{"id":"552207","messageId":"53eac227-1034-4dd5-9f4d-416537dcdd1e@gmail.com","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-3-6733c90ca5b0@pks.im","subject":"Re: [PATCH v2 03/11] builtin/refs: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-08T10:55:35Z","receivedAt":"2026-09-08T10:55:39Z","isPatch":true,"body":"On 9/7/26 16:48, Patrick Steinhardt wrote:\n> index 5cd21c25fe..53b12accaf 100644\n> --- a/builtin/refs.c\n> +++ b/builtin/refs.c\n> @@ -10,7 +10,7 @@\n>   #include \"refs/refs-internal.h\"\n>   \n>   #define REFS_MIGRATE_USAGE \\\n> -\tN_(\"git refs migrate --ref-format=<format> [--no-reflog] [--dry-run]\")\n> +\tN_(\"git refs migrate --ref-storage-format=<format> [--no-reflog] [--dry-run]\")\n>   \n>   #define REFS_VERIFY_USAGE \\\n>   \tN_(\"git refs verify [--strict] [--verbose]\")\n> @@ -44,9 +44,12 @@ static int cmd_refs_migrate(int argc, const char **argv, const char *prefix,\n>   \tenum ref_storage_format format;\n>   \tunsigned int flags = 0;\n>   \tstruct option options[] = {\n> -\t\tOPT_STRING_F(0, \"ref-format\", &format_str, N_(\"format\"),\n> -\t\t\tN_(\"specify the reference format to convert to\"),\n> +\t\tOPT_STRING_F(0, \"ref-storage-format\", &format_str, N_(\"format\"),\n> +\t\t\tN_(\"specify the reference storage format to convert to\"),\n>   \t\t\tPARSE_OPT_NONEG),\n\nThis is a bit of a tangent to the change that the patch aims for.\n\nThe `PARSE_OPT_NONEG` flag made me wonder if we needed the same in other \ncommands that accept this argument too. I tried to take a quick look at \nthe series that introduced the `git refs` command and I could not find \nany specific rationale behind why the argument to this specific command \nshould have the PARSE_OPT_NONEG flag. May be we could drop the flag for \n`git refs` command to make it consistent with how the argument is \nsupported in other commands?\n\nEither way not a show-stopper for this series, of course.\n\nRest of the patch looks good to me.\n\n--\nSivaraam\n\n"},{"id":"552212","messageId":"54fc5f97-a8ed-4927-8b48-1b4c3c7b413a@gmail.com","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-7-6733c90ca5b0@pks.im","subject":"Re: [PATCH v2 07/11] refs: expose function to parse reference URIs","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-08T13:47:06Z","receivedAt":"2026-09-08T13:47:17Z","isPatch":true,"body":"On 9/7/26 16:48, Patrick Steinhardt wrote:\n> In the next commit we're about to add more sites that want to parse a\n> reference backends URI into a format and payload. Expose a new function\n> `ref_storage_format_by_uri()` that enables this.\n> \n> Signed-off-by: Patrick Steinhardt <ps@pks.im>\n> ---\n\n>   enum ref_transaction_error {\n>   \t/* Default error code */\n>   \tREF_TRANSACTION_ERROR_GENERIC = -1,\n> diff --git a/setup.c b/setup.c\n> index dfe05d9a03..3be7dac452 100644\n> --- a/setup.c\n> +++ b/setup.c\n>\n> @@ -2069,16 +2051,12 @@ const char *setup_git_directory_gently(struct repository *repo, int *nongit_ok)\n>   \t\t\t */\n>   \t\t\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n>   \t\t\tif (ref_backend_uri) {\n> -\t\t\t\tchar *format;\n> -\n> -\t\t\t\tfree(discovery.format.ref_storage_payload);\n> -\n> -\t\t\t\tparse_reference_uri(ref_backend_uri, &format, &discovery.format.ref_storage_payload);\n> -\t\t\t\tdiscovery.format.ref_storage_format = ref_storage_format_by_name(format);\n> +\t\t\t\tFREE_AND_NULL(discovery.format.ref_storage_payload);\n> +\t\t\t\tdiscovery.format.ref_storage_format =\n> +\t\t\t\t\tref_storage_format_by_uri(ref_backend_uri,\n> +\t\t\t\t\t\t\t\t  &discovery.format.ref_storage_payload);\n>   \t\t\t\tif (discovery.format.ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n> -\t\t\t\t\tdie(_(\"unknown ref storage format: '%s'\"), format);\n> -\n> -\t\t\t\tfree(format);\n> +\t\t\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n\nIf I'm not mistaken, we have now started printing the whole ref storage \nbackend configuration rather than just the name. I could see that we \ndon't actually have any variable that returns just the name part after \nthe refactor. I could also understand that we can't always expect a \n'://' in the GIT_REF_STORAGE_FORMAT configuration so printing the whole \nconfiguration may make sense. But could we possibly improve the error \nmessage a bit? May be phrase it as follows:\n\n   $ GIT_REF_STORAGE_FORMAT=garbage://hello-world ./git status\n   fatal: invalid ref storage format configuration: 'garbage://hello-world'\n\n> @@ -2806,18 +2784,16 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n>   \n>   \tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n>   \tif (ref_backend_uri) {\n> -\t\tchar *backend, *payload;\n>   \t\tenum ref_storage_format format;\n> +\t\tchar *payload;\n>   \n> -\t\tparse_reference_uri(ref_backend_uri, &backend, &payload);\n> -\t\tformat = ref_storage_format_by_name(backend);\n> +\t\tformat = ref_storage_format_by_uri(ref_backend_uri, &payload);\n>   \t\tif (format == REF_STORAGE_FORMAT_UNKNOWN)\n> -\t\t\tdie(_(\"unknown ref storage format: '%s'\"), backend);\n> +\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n>   \n\nDitto here.\n\n--\nSivaraam\n\n"},{"id":"552296","messageId":"aqED9Xn6xibcp9pf@pks.im","threadId":"66284","inReplyTo":"aacc3fcb-43e6-4f62-b083-5fbabaa9f494@gmail.com","subject":"Re: [PATCH v2 01/11] builtin/init: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-09T07:00:05Z","receivedAt":"2026-09-09T07:00:17Z","isPatch":true,"body":"On Tue, Sep 08, 2026 at 02:31:22PM +0530, Kaartic Sivaraam wrote:\n> On 9/7/26 16:48, Patrick Steinhardt wrote:\n> \n> > Instead, this and subsequent patches will fix the mess by consistently\n> > referring to the ref storage format as such throughout all options,\n> > environment variables and config settings. This new name much more\n> > closely indicates that it is about how we store data and finally brings\n> > consistency into this area. We will keep the old names working of course\n> > for the sake of backwards compatibility.\n> > \n> \n> Just a doubt regarding the old option. At the moment, the patch appears to\n> introduce the new name alongside the old name. Do we not plan on deprecating\n> the old one and issue a warning to users when it is used so that we could\n> eventually retire it at some point?\n\nI'm aiming for a a quiet deprecation -- the old options keep on working,\nbut we don't show them anymore. We may eventually remove them\naltogether, but I neither want to warn about use of old options now or\neven remove them as that would likely cause more negative consequences\nthan is worth it. It's not like we want to soon use the old names.\n\n> > diff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc\n> > index 7b4abdaf8b..a048f0bddc 100644\n> > --- a/Documentation/config/init.adoc\n> > +++ b/Documentation/config/init.adoc\n> > @@ -15,7 +15,7 @@ endif::[]\n> >   \tthis config.\n> >   `init.defaultRefFormat`::\n> >   \tAllows overriding the default ref storage format for new repositories.\n> > -\tSee `--ref-format=` in linkgit:git-init[1]. Both the command line\n> > +\tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n> >   \toption and the `GIT_DEFAULT_REF_FORMAT` environment variable take\n> >   \tprecedence over this config.\n> \n> Relevant only if we are deprecating the old option: we need to mention that\n> the old one is deprecated in the documentation so that users are aware of\n> the same.\n\nBut I agree that we should keep the old options documented. Otherwise,\nit might be hard to figure out what those options do in case they for\nexample still exist in an old script.\n\n> > diff --git a/builtin/init-db.c b/builtin/init-db.c\n> > index e96b1283b7..63f33154c0 100644\n> > --- a/builtin/init-db.c\n> > +++ b/builtin/init-db.c\n> > @@ -57,7 +57,7 @@ static int shared_callback(const struct option *opt, const char *arg, int unset)\n> >   static const char *const init_db_usage[] = {\n> >   \tN_(\"git init [-q | --quiet] [--bare] [--template=<template-directory>]\\n\"\n> >   \t   \"         [--separate-git-dir <git-dir>] [--object-format=<format>]\\n\"\n> > -\t   \"         [--ref-format=<format>]\\n\"\n> > +\t   \"         [--ref-storage-format=<format>]\\n\"\n> >   \t   \"         [-b <branch-name> | --initial-branch=<branch-name>]\\n\"\n> >   \t   \"         [--shared[=<permissions>]] [<directory>]\"),\n> >   \tNULL\n> > @@ -83,7 +83,7 @@ int cmd_init_db(int argc,\n> >   \tunsigned int flags = 0;\n> >   \tint bare = startup_info->force_bare_repository ? 1 : -1;\n> >   \tconst char *object_format = NULL;\n> > -\tconst char *ref_format = NULL;\n> > +\tconst char *ref_storage_format_str = NULL;\n> >   \tconst char *initial_branch = NULL;\n> >   \tint hash_algo = GIT_HASH_UNKNOWN;\n> >   \tenum ref_storage_format ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;\n> > @@ -109,8 +109,10 @@ int cmd_init_db(int argc,\n> >   \t\t\t   N_(\"override the name of the initial branch\")),\n> >   \t\tOPT_STRING(0, \"object-format\", &object_format, N_(\"hash\"),\n> >   \t\t\t   N_(\"specify the hash algorithm to use\")),\n> > -\t\tOPT_STRING(0, \"ref-format\", &ref_format, N_(\"format\"),\n> > -\t\t\t   N_(\"specify the reference format to use\")),\n> > +\t\tOPT_STRING(0, \"ref-storage-format\", &ref_storage_format_str, N_(\"format\"),\n> > +\t\t\t   N_(\"specify the reference storage format to use\")),\n> > +\t\tOPT_STRING_F(0, \"ref-format\", &ref_storage_format_str, N_(\"format\"),\n> > +\t\t\t   N_(\"specify the reference storage format to use\"), PARSE_OPT_HIDDEN),\n> \n> Relevant only if we are deprecating the old option: We could change the\n> description of the old option to convey that it is deprecated so that it\n> could be easily distinguished by anyone reading through. I suggest this by\n> noting a similar pattern in `builtin/name-rev.c` for the `--stdin` argument.\n\nWe don't really have to update the description as we pass\n`PARSE_OPT_HIDDEN` anyway, so the option is not even shown.\n\n> If we don't plan to deprecate, I suppose we could use OPT_ALIAS to clarify\n> that `ref-format` is an alias of `ref-storage-format` similar to how\n> `recursive` is marked as an alias of `recurse-submodules` in\n> `builtin/clone.c`.\n\nI was originally planning to use `OPT_ALIAS()`, but we don't seem to\nsupport `PARSE_OPT_HIDDEN` there. Maybe it's better to add a small\npreparatory patch to support that though.\n\nPatrick\n"},{"id":"552297","messageId":"aqEEx09ikVI5vFrT@pks.im","threadId":"66284","inReplyTo":"1cbb335d-ed50-4e6d-9d11-bd09de1bcee3@gmail.com","subject":"Re: [PATCH v2 02/11] builtin/clone: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-09T07:03:35Z","receivedAt":"2026-09-09T07:03:41Z","isPatch":true,"body":"On Tue, Sep 08, 2026 at 02:51:37PM +0530, Kaartic Sivaraam wrote:\n> On 9/7/26 16:48, Patrick Steinhardt wrote:\n> > diff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh\n> > index 1ca245c732..5eaf689d74 100755\n> > --- a/t/t7424-submodule-mixed-ref-formats.sh\n> > +++ b/t/t7424-submodule-mixed-ref-formats.sh\n> > @@ -63,9 +63,9 @@ test_expect_success 'recursive clone propagates ref storage format' '\n> >   \ttest_ref_format upstream/submodule \"$GIT_DEFAULT_REF_FORMAT\" &&\n> >   \t# The cloned repositories should use the other ref format that we have\n> > -\t# specified via `--ref-format`. The option should propagate to cloned\n> > +\t# specified via `--ref-storage`. The option should propagate to cloned\n> \n> s/ref-storage/ref-storage-format\n> \n> Rest of the patch looks fine to me.\n\nWell spotted, fixed now.\n\nPatrick\n"},{"id":"552298","messageId":"aqEE0PdjrRnLDkGA@pks.im","threadId":"66284","inReplyTo":"53eac227-1034-4dd5-9f4d-416537dcdd1e@gmail.com","subject":"Re: [PATCH v2 03/11] builtin/refs: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-09T07:03:44Z","receivedAt":"2026-09-09T07:03:49Z","isPatch":true,"body":"On Tue, Sep 08, 2026 at 04:25:35PM +0530, Kaartic Sivaraam wrote:\n> On 9/7/26 16:48, Patrick Steinhardt wrote:\n> > index 5cd21c25fe..53b12accaf 100644\n> > --- a/builtin/refs.c\n> > +++ b/builtin/refs.c\n> > @@ -10,7 +10,7 @@\n> >   #include \"refs/refs-internal.h\"\n> >   #define REFS_MIGRATE_USAGE \\\n> > -\tN_(\"git refs migrate --ref-format=<format> [--no-reflog] [--dry-run]\")\n> > +\tN_(\"git refs migrate --ref-storage-format=<format> [--no-reflog] [--dry-run]\")\n> >   #define REFS_VERIFY_USAGE \\\n> >   \tN_(\"git refs verify [--strict] [--verbose]\")\n> > @@ -44,9 +44,12 @@ static int cmd_refs_migrate(int argc, const char **argv, const char *prefix,\n> >   \tenum ref_storage_format format;\n> >   \tunsigned int flags = 0;\n> >   \tstruct option options[] = {\n> > -\t\tOPT_STRING_F(0, \"ref-format\", &format_str, N_(\"format\"),\n> > -\t\t\tN_(\"specify the reference format to convert to\"),\n> > +\t\tOPT_STRING_F(0, \"ref-storage-format\", &format_str, N_(\"format\"),\n> > +\t\t\tN_(\"specify the reference storage format to convert to\"),\n> >   \t\t\tPARSE_OPT_NONEG),\n> \n> This is a bit of a tangent to the change that the patch aims for.\n> \n> The `PARSE_OPT_NONEG` flag made me wonder if we needed the same in other\n> commands that accept this argument too. I tried to take a quick look at the\n> series that introduced the `git refs` command and I could not find any\n> specific rationale behind why the argument to this specific command should\n> have the PARSE_OPT_NONEG flag. May be we could drop the flag for `git refs`\n> command to make it consistent with how the argument is supported in other\n> commands?\n> \n> Either way not a show-stopper for this series, of course.\n\nWe might want to do that, yeah. But it's certainly outside the scope of\nthis patch series, so I'll not include it here.\n\nPatrick\n"},{"id":"552299","messageId":"aqEE14FdUFdgMNS2@pks.im","threadId":"66284","inReplyTo":"54fc5f97-a8ed-4927-8b48-1b4c3c7b413a@gmail.com","subject":"Re: [PATCH v2 07/11] refs: expose function to parse reference URIs","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-09T07:03:51Z","receivedAt":"2026-09-09T07:03:57Z","isPatch":true,"body":"On Tue, Sep 08, 2026 at 07:17:06PM +0530, Kaartic Sivaraam wrote:\n> On 9/7/26 16:48, Patrick Steinhardt wrote:\n> > diff --git a/setup.c b/setup.c\n> > index dfe05d9a03..3be7dac452 100644\n> > --- a/setup.c\n> > +++ b/setup.c\n> > \n> > @@ -2069,16 +2051,12 @@ const char *setup_git_directory_gently(struct repository *repo, int *nongit_ok)\n> >   \t\t\t */\n> >   \t\t\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n> >   \t\t\tif (ref_backend_uri) {\n> > -\t\t\t\tchar *format;\n> > -\n> > -\t\t\t\tfree(discovery.format.ref_storage_payload);\n> > -\n> > -\t\t\t\tparse_reference_uri(ref_backend_uri, &format, &discovery.format.ref_storage_payload);\n> > -\t\t\t\tdiscovery.format.ref_storage_format = ref_storage_format_by_name(format);\n> > +\t\t\t\tFREE_AND_NULL(discovery.format.ref_storage_payload);\n> > +\t\t\t\tdiscovery.format.ref_storage_format =\n> > +\t\t\t\t\tref_storage_format_by_uri(ref_backend_uri,\n> > +\t\t\t\t\t\t\t\t  &discovery.format.ref_storage_payload);\n> >   \t\t\t\tif (discovery.format.ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n> > -\t\t\t\t\tdie(_(\"unknown ref storage format: '%s'\"), format);\n> > -\n> > -\t\t\t\tfree(format);\n> > +\t\t\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n> \n> If I'm not mistaken, we have now started printing the whole ref storage\n> backend configuration rather than just the name. I could see that we don't\n> actually have any variable that returns just the name part after the\n> refactor. I could also understand that we can't always expect a '://' in the\n> GIT_REF_STORAGE_FORMAT configuration so printing the whole configuration may\n> make sense. But could we possibly improve the error message a bit? May be\n> phrase it as follows:\n> \n>   $ GIT_REF_STORAGE_FORMAT=garbage://hello-world ./git status\n>   fatal: invalid ref storage format configuration: 'garbage://hello-world'\n\nI think \"invalid\" would be less precise though compared to \"unknown\", so\nI'm inclined to keep the wording here. I don't think it's too bad that\nwe're now printing the whole URI, as that may also make the user wonder\nless about where specifically that string even comes from.\n\nSo for now, I'll leave this as-is.\n\nPatrick\n"},{"id":"552300","messageId":"be1c7560-0da6-436e-8f46-073e95bcad07@gmail.com","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-8-6733c90ca5b0@pks.im","subject":"Re: [PATCH v2 08/11] setup: refactor how we configure the ref storage format","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-09T08:00:55Z","receivedAt":"2026-09-09T08:01:00Z","isPatch":true,"body":"On 9/7/26 16:48, Patrick Steinhardt wrote:\n> diff --git a/setup.c b/setup.c\n> index 3be7dac452..38fa5e854c 100644\n> --- a/setup.c\n> +++ b/setup.c\n> @@ -2761,40 +2761,65 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n>\n> ... snip ...\n> -\n> -\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n> -\tif (ref_backend_uri) {\n> -\t\tenum ref_storage_format format;\n> -\t\tchar *payload;\n> -\n> -\t\tformat = ref_storage_format_by_uri(ref_backend_uri, &payload);\n> -\t\tif (format == REF_STORAGE_FORMAT_UNKNOWN)\n> -\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n> -\n> -\t\trepo_fmt->ref_storage_format = format;\n> -\t\tfree(repo_fmt->ref_storage_payload);\n> -\t\trepo_fmt->ref_storage_payload = payload;\n> -\t}\n> +\t/*\n> +\t * If we have a preexisting repository we need to verify that its\n> +\t * current ref storage format does not change.\n> +\t */\n> +\tif (repo_fmt->version >= 0) {\n> +\t\tif (ref_storage_format != repo_fmt->ref_storage_format)\n> +\t\t\tdie(_(\"attempt to reinitialize repository with different reference storage format\"));\n> +\t\tif ((ref_storage_payload || repo_fmt->ref_storage_payload) &&\n> +\t\t    strcmp(ref_storage_payload ? ref_storage_payload : \"\",\n> +\t\t\t   repo_fmt->ref_storage_payload ? repo_fmt->ref_storage_payload : \"\"))\n\nRather than a strcmp, wouldn't it be ideal to do the path comparison \nusing strbuf_realpath to make sure we avoid similar paths like the \nfollowing from failing during reinitialization?\n\n   $ mkdir store\n   $ git init --ref-storage-format=\"files://$PWD/store\" r1\n   Initialized empty Git repository in .../r1/.git/\n   $ git init --ref-storage-format=\"files://$PWD/store\" r1\n   Reinitialized existing Git repository in .../r1/.git/\n   $ git init --ref-storage-format=\"files://$PWD/./store\" r1\n   fatal: attempt to reinitialize repository with different reference \nstorage payload\n\nThis matches with how we actually make use of the path at runtime in the \nrefs_compute_filesystem_location function in refs.c.\n\nRest of the patch looks good.\n\n-- \nSivaraam\n"},{"id":"552301","messageId":"57f08562-ecea-4e51-8e5a-ae3aa91b23d1@gmail.com","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-9-6733c90ca5b0@pks.im","subject":"Re: [PATCH v2 09/11] setup: rename ref storage format environment variables","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-09T08:10:07Z","receivedAt":"2026-09-09T08:10:13Z","isPatch":true,"body":"On 9/7/26 16:48, Patrick Steinhardt wrote:\n> \n> diff --git a/Documentation/config/init.adoc b/Documentation/config/init.adoc\n> index a048f0bddc..f82fcf25e6 100644\n> --- a/Documentation/config/init.adoc\n> +++ b/Documentation/config/init.adoc\n> @@ -16,7 +16,7 @@ endif::[]\n>   `init.defaultRefFormat`::\n>   \tAllows overriding the default ref storage format for new repositories.\n>   \tSee `--ref-storage-format=` in linkgit:git-init[1]. Both the command line\n> -\toption and the `GIT_DEFAULT_REF_FORMAT` environment variable take\n> +\toption and the `GIT_DEFAULT_REF_STORAGE_FORMAT` environment variable take\n>   \tprecedence over this config.\n>   \n>   init.defaultSubmodulePathConfig::\n> diff --git a/Documentation/git.adoc b/Documentation/git.adoc\n> index 23ba65656e..d78e2b5c10 100644\n> --- a/Documentation/git.adoc\n> +++ b/Documentation/git.adoc\n> @@ -590,15 +590,15 @@ double-quotes and respecting backslash escapes. E.g., the value\n>   \tis always used. The default is \"sha1\".\n>   \tSee `--object-format` in linkgit:git-init[1].\n>   \n> -`GIT_DEFAULT_REF_FORMAT`::\n> -\tIf this variable is set, the default reference backend format for new\n> +`GIT_DEFAULT_REF_STORAGE_FORMAT`::\n> +\tIf this variable is set, the default ref storage format for new\n>   \trepositories will be set to this value. The default is \"files\".\n>   \tSee `--ref-storage-format` in linkgit:git-init[1].\n>   \n> -`GIT_REFERENCE_BACKEND`::\n> -    Specify which reference backend to be used along with its URI.\n> -    See `extensions.refStorage` option in linkgit:git-config[1] for more\n> -    details. Overrides the config variable when used.\n> +`GIT_REF_STORAGE_FORMAT`::\n> +\tSpecify which ref storage format to use along with its URI.\n> +\tSee `extensions.refStorage` option in linkgit:git-config[1] for more\n> +\tdetails. Overrides the config variable when used.\n>   \n\nGiven rationale about retaining the documentation discussed in another \nmail in this thread, I think we could do so here too.\n\n> @@ -2785,19 +2788,21 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n>   \t */\n>   \tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n>   \t\t/* nothing to do */\n> -\t} else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) {\n> +\t} else if (((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT)) ||\n> +\t\t    (env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT)))) {\n>   \t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n>   \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n>   \t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n> -\t\t\t    GIT_REFERENCE_BACKEND_ENVIRONMENT, env);\n> +\t\t\t    GIT_REF_STORAGE_FORMAT_ENVIRONMENT, env);\n\nWe're getting the value from GIT_REFERENCE_BACKEND_ENVIRONMENT as a \nfallback but we are mentioning only GIT_REF_STORAGE_FORMAT_ENVIRONMENT \nin the error message. Would this not be misleading if the value actually \ncomes from GIT_REFERENCE_BACKEND_ENVIRONMENT?\n\n>   \t} else if (repo_fmt->version >= 0) {\n>   \t\tref_storage_format = repo_fmt->ref_storage_format;\n>   \t\tref_storage_payload = xstrdup_or_null(repo_fmt->ref_storage_payload);\n> -\t} else if ((env = getenv(\"GIT_DEFAULT_REF_FORMAT\"))) {\n> +\t} else if (((env = getenv(\"GIT_DEFAULT_REF_STORAGE_FORMAT\")) ||\n> +\t\t    (env = getenv(\"GIT_DEFAULT_REF_FORMAT\")))) {\n>   \t\tref_storage_format = ref_storage_format_by_name(env);\n>   \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n>   \t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n> -\t\t\t    \"GIT_DEFAULT_REF_FORMAT\", env);\n> +\t\t\t    \"GIT_DEFAULT_REF_STORAGE_FORMAT\", env);\n\nDitto here.\n\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 1f0505e412..60a2179a0a 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -575,8 +575,8 @@ export EDITOR\n>   GIT_TEST_BUILTIN_HASH=$(\"$GIT_BINARY\" version --build-options | sed -ne 's/^default-hash: //p')\n>   GIT_DEFAULT_HASH=\"${GIT_TEST_DEFAULT_HASH:-$GIT_TEST_BUILTIN_HASH}\"\n>   export GIT_DEFAULT_HASH\n> -GIT_DEFAULT_REF_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n> -export GIT_DEFAULT_REF_FORMAT\n> +GIT_DEFAULT_REF_STORAGE_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n> +export GIT_DEFAULT_REF_STORAGE_FORMAT\n>   \n\nWould it make sense to also rename GIT_TEST_DEFAULT_REF_FORMAT to \nGIT_TEST_DEFAULT_REF_STORAGE_FORMAT for consistency sake?\n\n-- \nSivaraam\n\n"},{"id":"552306","messageId":"b2e0b347-5847-4ed8-bef9-441fc4dccd8e@gmail.com","threadId":"66284","inReplyTo":"20260907-b4-pks-unify-ref-storage-format-v2-11-6733c90ca5b0@pks.im","subject":"Re: [PATCH v2 11/11] setup: allow \"git init --ref-storage-format=\" to specify a payload","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-09T08:54:28Z","receivedAt":"2026-09-09T08:54:33Z","isPatch":true,"body":"On 9/7/26 16:48, Patrick Steinhardt wrote:\n>   \n> diff --git a/Documentation/ref-storage-format.adoc b/Documentation/ref-storage-format.adoc\n> index c5e29ec831..21d62557b7 100644\n> --- a/Documentation/ref-storage-format.adoc\n> +++ b/Documentation/ref-storage-format.adoc\n> @@ -1,8 +1,12 @@\n> -`files`;; for loose files with packed-refs.\n> +`files[://<path>]`;; for loose files with packed-refs. The optional payload can\n> +be specified to change the root directory where references are created. A\n> +relative path will be resolved relative to the repository's common directory.\n>   ifndef::with-breaking-changes[]\n>   \tThis is the default.\n>   endif::with-breaking-changes[]\n> -`reftable`;; for the reftable format.\n> +`reftable[://<path>]`;; for the reftable format. The optional payload can\n> +be specified to change the root directory where references are created. A\n> +relative path will be resolved relative to the repository's common directory.\n>   ifdef::with-breaking-changes[]\n>   \tThis is the default.\n>   endif::with-breaking-changes[]\n\nI think we need to be a bit more careful when modifying this ascii doc. \nThis is also included in Documentation/git-refs.adoc and \nDocumentation/git-repo.adoc.\n\nWe need to check if support should also be added to the former. For the \nlatter, I think the inclusion may be fine since it is only for \ninformational purposes.\n\nRest of the patch looks good to me.\n\n-- \nSivaraam\n\n"},{"id":"552308","messageId":"472d9d2b-efea-48a9-98f0-02364b1a9ccf@gmail.com","threadId":"66284","inReplyTo":"aqED9Xn6xibcp9pf@pks.im","subject":"Re: [PATCH v2 01/11] builtin/init: rename \"--ref-format=\" to \"--ref-storage-format=\"","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2026-09-09T09:14:43Z","receivedAt":"2026-09-09T09:14:49Z","isPatch":true,"body":"On 9/9/26 12:30, Patrick Steinhardt wrote:\n> On Tue, Sep 08, 2026 at 02:31:22PM +0530, Kaartic Sivaraam wrote:\n> \n> I'm aiming for a a quiet deprecation -- the old options keep on working,\n> but we don't show them anymore. We may eventually remove them\n> altogether, but I neither want to warn about use of old options now or\n> even remove them as that would likely cause more negative consequences\n> than is worth it. It's not like we want to soon use the old names.\n> \n\nUnderstood.\n\n> \n> But I agree that we should keep the old options documented. Otherwise,\n> it might be hard to figure out what those options do in case they for\n> example still exist in an old script.\n> \n\nYeah, makes sense.\n\n>>\n>> Relevant only if we are deprecating the old option: We could change the\n>> description of the old option to convey that it is deprecated so that it\n>> could be easily distinguished by anyone reading through. I suggest this by\n>> noting a similar pattern in `builtin/name-rev.c` for the `--stdin` argument.\n> \n> We don't really have to update the description as we pass\n> `PARSE_OPT_HIDDEN` anyway, so the option is not even shown.\n>\n\nIndeed. I was suggesting to change the description only for the sake of \nsomeone who reads the code to quickly get an idea that we have \ndeprecated the old names. The PARSE_OPT_HIDDEN would definitely hint at \nit but this just a suggestion to make it more obvious :-)\n\nThat said, it's fine if we don't change the description too. It isn't a \nbig deal.\n\n>> If we don't plan to deprecate, I suppose we could use OPT_ALIAS to clarify\n>> that `ref-format` is an alias of `ref-storage-format` similar to how\n>> `recursive` is marked as an alias of `recurse-submodules` in\n>> `builtin/clone.c`.\n> \n> I was originally planning to use `OPT_ALIAS()`, but we don't seem to\n> support `PARSE_OPT_HIDDEN` there. Maybe it's better to add a small\n> preparatory patch to support that though.\n> \n\nIndeed. OPT_ALIAS does have that caveat. A patch to allow the alias to \nbe hidden by choice would indeed be worthwhile.\n\n-- \nSivaraam\n\n"},{"id":"552309","messageId":"aqElkBmqoOqb0J5b@pks.im","threadId":"66284","inReplyTo":"57f08562-ecea-4e51-8e5a-ae3aa91b23d1@gmail.com","subject":"Re: [PATCH v2 09/11] setup: rename ref storage format environment variables","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-09T09:23:28Z","receivedAt":"2026-09-09T09:23:35Z","isPatch":true,"body":"On Wed, Sep 09, 2026 at 01:40:07PM +0530, Kaartic Sivaraam wrote:\n> On 9/7/26 16:48, Patrick Steinhardt wrote:\n> > @@ -2785,19 +2788,21 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n> >   \t */\n> >   \tif (ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN) {\n> >   \t\t/* nothing to do */\n> > -\t} else if ((env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT))) {\n> > +\t} else if (((env = getenv(GIT_REF_STORAGE_FORMAT_ENVIRONMENT)) ||\n> > +\t\t    (env = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT)))) {\n> >   \t\tref_storage_format = ref_storage_format_by_uri(env, &ref_storage_payload);\n> >   \t\tif (ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)\n> >   \t\t\tdie(_(\"unknown ref storage format specified via %s: '%s'\"),\n> > -\t\t\t    GIT_REFERENCE_BACKEND_ENVIRONMENT, env);\n> > +\t\t\t    GIT_REF_STORAGE_FORMAT_ENVIRONMENT, env);\n> \n> We're getting the value from GIT_REFERENCE_BACKEND_ENVIRONMENT as a fallback\n> but we are mentioning only GIT_REF_STORAGE_FORMAT_ENVIRONMENT in the error\n> message. Would this not be misleading if the value actually comes from\n> GIT_REFERENCE_BACKEND_ENVIRONMENT?\n\nYeah, fair. I already had this on my radar, but thought that the\nsolution was a bit too ugly because it resulted in a bit of duplication.\nI was thus sweeping this under the rug a bit, if I'm being totally\nhonest.\n\nAnyway, will adapt.\n\n> > diff --git a/t/test-lib.sh b/t/test-lib.sh\n> > index 1f0505e412..60a2179a0a 100644\n> > --- a/t/test-lib.sh\n> > +++ b/t/test-lib.sh\n> > @@ -575,8 +575,8 @@ export EDITOR\n> >   GIT_TEST_BUILTIN_HASH=$(\"$GIT_BINARY\" version --build-options | sed -ne 's/^default-hash: //p')\n> >   GIT_DEFAULT_HASH=\"${GIT_TEST_DEFAULT_HASH:-$GIT_TEST_BUILTIN_HASH}\"\n> >   export GIT_DEFAULT_HASH\n> > -GIT_DEFAULT_REF_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n> > -export GIT_DEFAULT_REF_FORMAT\n> > +GIT_DEFAULT_REF_STORAGE_FORMAT=\"${GIT_TEST_DEFAULT_REF_FORMAT:-files}\"\n> > +export GIT_DEFAULT_REF_STORAGE_FORMAT\n> \n> Would it make sense to also rename GIT_TEST_DEFAULT_REF_FORMAT to\n> GIT_TEST_DEFAULT_REF_STORAGE_FORMAT for consistency sake?\n\nOh, that one I completely missed. Good catch, thanks!\n\nPatrick\n"},{"id":"552310","messageId":"aqEllv3TicOLB7g0@pks.im","threadId":"66284","inReplyTo":"be1c7560-0da6-436e-8f46-073e95bcad07@gmail.com","subject":"Re: [PATCH v2 08/11] setup: refactor how we configure the ref storage format","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-09T09:23:34Z","receivedAt":"2026-09-09T09:23:38Z","isPatch":true,"body":"On Wed, Sep 09, 2026 at 01:30:55PM +0530, Kaartic Sivaraam wrote:\n> On 9/7/26 16:48, Patrick Steinhardt wrote:\n> > diff --git a/setup.c b/setup.c\n> > index 3be7dac452..38fa5e854c 100644\n> > --- a/setup.c\n> > +++ b/setup.c\n> > @@ -2761,40 +2761,65 @@ static void repository_format_configure(struct repository_format *repo_fmt,\n> > \n> > ... snip ...\n> > -\n> > -\tref_backend_uri = getenv(GIT_REFERENCE_BACKEND_ENVIRONMENT);\n> > -\tif (ref_backend_uri) {\n> > -\t\tenum ref_storage_format format;\n> > -\t\tchar *payload;\n> > -\n> > -\t\tformat = ref_storage_format_by_uri(ref_backend_uri, &payload);\n> > -\t\tif (format == REF_STORAGE_FORMAT_UNKNOWN)\n> > -\t\t\tdie(_(\"unknown ref storage format: '%s'\"), ref_backend_uri);\n> > -\n> > -\t\trepo_fmt->ref_storage_format = format;\n> > -\t\tfree(repo_fmt->ref_storage_payload);\n> > -\t\trepo_fmt->ref_storage_payload = payload;\n> > -\t}\n> > +\t/*\n> > +\t * If we have a preexisting repository we need to verify that its\n> > +\t * current ref storage format does not change.\n> > +\t */\n> > +\tif (repo_fmt->version >= 0) {\n> > +\t\tif (ref_storage_format != repo_fmt->ref_storage_format)\n> > +\t\t\tdie(_(\"attempt to reinitialize repository with different reference storage format\"));\n> > +\t\tif ((ref_storage_payload || repo_fmt->ref_storage_payload) &&\n> > +\t\t    strcmp(ref_storage_payload ? ref_storage_payload : \"\",\n> > +\t\t\t   repo_fmt->ref_storage_payload ? repo_fmt->ref_storage_payload : \"\"))\n> \n> Rather than a strcmp, wouldn't it be ideal to do the path comparison using\n> strbuf_realpath to make sure we avoid similar paths like the following from\n> failing during reinitialization?\n> \n>   $ mkdir store\n>   $ git init --ref-storage-format=\"files://$PWD/store\" r1\n>   Initialized empty Git repository in .../r1/.git/\n>   $ git init --ref-storage-format=\"files://$PWD/store\" r1\n>   Reinitialized existing Git repository in .../r1/.git/\n>   $ git init --ref-storage-format=\"files://$PWD/./store\" r1\n>   fatal: attempt to reinitialize repository with different reference storage\n> payload\n> \n> This matches with how we actually make use of the path at runtime in the\n> refs_compute_filesystem_location function in refs.c.\n\nNo, because that'd assume that the payload even is a path. But in\ntheory, it could be anything, like for example a database host to\nconnect to. In `refs_compute_filesystem_location()` it's a different\nthing though as that call happens inside the backends themselves, and\nthey know what kind of payload to expect.\n\nPatrick\n"},{"id":"552311","messageId":"aqEln6yto1xVNjqz@pks.im","threadId":"66284","inReplyTo":"b2e0b347-5847-4ed8-bef9-441fc4dccd8e@gmail.com","subject":"Re: [PATCH v2 11/11] setup: allow \"git init --ref-storage-format=\" to specify a payload","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-09T09:23:43Z","receivedAt":"2026-09-09T09:23:47Z","isPatch":true,"body":"On Wed, Sep 09, 2026 at 02:24:28PM +0530, Kaartic Sivaraam wrote:\n> On 9/7/26 16:48, Patrick Steinhardt wrote:\n> > diff --git a/Documentation/ref-storage-format.adoc b/Documentation/ref-storage-format.adoc\n> > index c5e29ec831..21d62557b7 100644\n> > --- a/Documentation/ref-storage-format.adoc\n> > +++ b/Documentation/ref-storage-format.adoc\n> > @@ -1,8 +1,12 @@\n> > -`files`;; for loose files with packed-refs.\n> > +`files[://<path>]`;; for loose files with packed-refs. The optional payload can\n> > +be specified to change the root directory where references are created. A\n> > +relative path will be resolved relative to the repository's common directory.\n> >   ifndef::with-breaking-changes[]\n> >   \tThis is the default.\n> >   endif::with-breaking-changes[]\n> > -`reftable`;; for the reftable format.\n> > +`reftable[://<path>]`;; for the reftable format. The optional payload can\n> > +be specified to change the root directory where references are created. A\n> > +relative path will be resolved relative to the repository's common directory.\n> >   ifdef::with-breaking-changes[]\n> >   \tThis is the default.\n> >   endif::with-breaking-changes[]\n> \n> I think we need to be a bit more careful when modifying this ascii doc. This\n> is also included in Documentation/git-refs.adoc and\n> Documentation/git-repo.adoc.\n> \n> We need to check if support should also be added to the former. For the\n> latter, I think the inclusion may be fine since it is only for informational\n> purposes.\n\nYeha, for git-repo(1) it's a good change even, I'd argue. But for the\nformer I'd also argue that git-refs(1) itself should learn to use URIs\nhere. But that's a bigger change, and one that I'd rather avoid doing as\npart of this already-huge patch series.\n\nYou know, I'll probably keep this specific change out and only change\ndocumentation of git-init(1) and git-clone(1) for now.\n\nThanks!\n\nPatrick\n"}]}