From: Karthik Nayak Date: Mon, 14 Sep 2026 09:33:32 GMT Subject: Re: [PATCH v3 01/13] parse-options: allow for hidden aliases Message-ID: In-Reply-To: <20260909-b4-pks-unify-ref-storage-format-v3-1-ca041fb40ad8@pks.im> TPatrick Steinhardt writes: > 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=] [--separate-git-dir ] [--object-format=] [--ref-storage-format=] [-b | --initial-branch=] [--shared[=]] [] --[no-]template directory from which templates will be used --[no-]bare create a bare repository --shared[=] specify that the git repository is to be shared amongst several users -q, --[no-]quiet be quiet --[no-]separate-git-dir separate git dir from working tree -b, --[no-]initial-branch override the name of the initial branch --[no-]object-format specify the hash algorithm to use --[no-]ref-storage-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=] [--separate-git-dir ] [--object-format=] [--ref-storage-format=] [-b | --initial-branch=] [--shared[=]] [] --[no-]template directory from which templates will be used --[no-]bare create a bare repository --shared[=] specify that the git repository is to be shared amongst several users -q, --[no-]quiet be quiet --[no-]separate-git-dir separate git dir from working tree -b, --[no-]initial-branch override the name of the initial branch --[no-]object-format specify the hash algorithm to use --[no-]ref-storage-format specify the reference storage format to use --[no-]ref-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]