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

Re: [PATCH v3 01/13] parse-options: allow for hidden aliases

From
Karthik Nayak <karthik.188@gmail.com>
Date
Sep 14, 2026, 09:33 UTC
Message-ID
<CAOLa=ZSh_H9tjnjEsRrmGXm1Ht+3a=gRaGibO6BKZvvkEabesQ@mail.gmail.com>
In-Reply-To
<20260909-b4-pks-unify-ref-storage-format-v3-1-ca041fb40ad8@pks.im>
TPatrick Steinhardt <ps@pks.im> writes:
Show 7 quoted lines
> The `OPT_ALIAS()` option can be used to create an exact alias that maps
> one option name to the same semantics as another option name. This
> option type is especially useful when deprecating an old name in favor
> of a new one. But curiously enough, we don't have the infrastructure in
> place to properly support this use case because we don't expose the
> ability to hide the alias via `PARSE_OPT_HIDDEN`.
>
If we're going to hide the alias, do we need to even use an alias?
❯ ~/code/git/build/bin-wrappers/git.thisseries init --foo
error: unknown option `foo'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>]
                [--separate-git-dir <git-dir>] [--object-format=<format>]
                [--ref-storage-format=<format>]
                [-b <branch-name> | --initial-branch=<branch-name>]
                [--shared[=<permissions>]] [<directory>]
    --[no-]template <template-directory>
                          directory from which templates will be used
    --[no-]bare           create a bare repository
    --shared[=<permissions>]
                          specify that the git repository is to be
shared amongst several users
    -q, --[no-]quiet      be quiet
    --[no-]separate-git-dir <gitdir>
                          separate git dir from working tree
    -b, --[no-]initial-branch <name>
                          override the name of the initial branch
    --[no-]object-format <hash>
                          specify the hash algorithm to use
    --[no-]ref-storage-format <format>
                          specify the reference storage format to use
❯ ~/code/git/build/bin-wrappers/git.withouthide init --foo
error: unknown option `foo'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>]
                [--separate-git-dir <git-dir>] [--object-format=<format>]
                [--ref-storage-format=<format>]
                [-b <branch-name> | --initial-branch=<branch-name>]
                [--shared[=<permissions>]] [<directory>]
    --[no-]template <template-directory>
                          directory from which templates will be used
    --[no-]bare           create a bare repository
    --shared[=<permissions>]
                          specify that the git repository is to be
shared amongst several users
    -q, --[no-]quiet      be quiet
    --[no-]separate-git-dir <gitdir>
                          separate git dir from working tree
    -b, --[no-]initial-branch <name>
                          override the name of the initial branch
    --[no-]object-format <hash>
                          specify the hash algorithm to use
    --[no-]ref-storage-format <format>
                          specify the reference storage format to use
    --[no-]ref-format <format>
                          alias of --ref-storage-format

Perhaps it doesn't make sense to add flags to OPT_ALIAS() at all? But this is indeed an alias and seems like the correct option to use, but feels wasted. I'm okay to keep it as is.

> Introduce a new `OPT_ALIAS_F()` function that allows the user to pass
> flags and propagate these flags when rewriting aliases to match their
> respective source options.
[snip]
Previous: Patrick SteinhardtNext: Kaartic Sivaraam
Message 3 of 20 in “Fix inconsistent ref storage format terminology”
  1. 00/13 Fix inconsistent ref storage format terminologyPatrick Steinhardt, Sep 9, 2026
  2. 01/13 parse-options: allow for hidden aliasesPatrick Steinhardt, Sep 9, 2026
  3. Karthik NayakSep 14, 2026
  4. Kaartic SivaraamSep 15, 2026
  5. Junio C HamanoSep 15, 2026
  6. 02/13 builtin/init: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 9, 2026
  7. 03/13 builtin/clone: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 9, 2026
  8. 04/13 builtin/refs: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 9, 2026
  9. 05/13 builtin/submodule: rename "--ref-format=" to "--ref-storage-format="Patrick Steinhardt, Sep 9, 2026
  10. 06/13 builtin/rev-parse: rename "--show-ref-format" to "--show-ref-storage-format"Patrick Steinhardt, Sep 9, 2026
  11. 07/13 help: rename "default-ref-format" to "default-ref-storage-format"Patrick Steinhardt, Sep 9, 2026
  12. 08/13 refs: expose function to parse reference URIsPatrick Steinhardt, Sep 9, 2026
  13. 09/13 setup: refactor how we configure the ref storage formatPatrick Steinhardt, Sep 9, 2026
  14. 10/13 setup: rename ref storage format environment variablesPatrick Steinhardt, Sep 9, 2026
  15. 11/13 t: rename GIT_TEST_DEFAULT_REF_FORMATPatrick Steinhardt, Sep 9, 2026
  16. 12/13 setup: rename "init.defaultRefFormat" to "init.defaultRefStorageFormat"Patrick Steinhardt, Sep 9, 2026
  17. 13/13 setup: allow "--ref-storage-format=" to specify a payloadPatrick Steinhardt, Sep 9, 2026
  18. Karthik NayakSep 14, 2026
  19. Junio C HamanoSep 14, 2026
  20. Kaartic SivaraamSep 14, 2026

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

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