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
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Sep 15, 2026, 09:32 UTC
Message-ID
<c5266fff-8247-48d2-9679-3fc1f649cf34@gmail.com>
In-Reply-To
<CAOLa=ZSh_H9tjnjEsRrmGXm1Ht+3a=gRaGibO6BKZvvkEabesQ@mail.gmail.com>
On 9/14/26 15:03, Karthik Nayak wrote:
Show 18 quoted lines
> Patrick Steinhardt <ps@pks.im> 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?
> 
> [snip]
> 
> 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.
> 

Just some food for thought. There are a couple of other instances where we are currently using OPT_ALIAS to represent the deprecated variant of an option. They are:

   1. `--recursive` is a deprecated alias of  `--recurse-submodule` in
      `git clone`
      cf. bb62e0a99f (clone: teach --recurse-submodules to optionally
      take a pathspec, 2017-03-17) and 5c387428f1 (parse-options: don't
      emit "ambiguous option" for aliases, 2019-04-29)
   2.  `--negotiation-tip` is a deprecated alias of
       `--negotiation-restrict` in `git fetch`
       cf. 1a445fc60b (fetch: add --negotiation-restrict option,
       2026-05-19)
       Note: The documentation clarifies that --negotiation-restrict is
       the preferred variant but does not mention about deprecation.

Since they are not hidden, the deprecated variants still show up in the help output of those commands. So, we appear to be doing fine with a public alias so far. So, may be it is not a big deal if we expose the deprecated option publicly?

-- 
Sivaraam
Previous: Karthik NayakNext: Junio C Hamano
Message 4 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.