Re: [PATCH v4 07/14] builtin/config: introduce "list" subcommand
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 3, 2024, 16:01 UTC
- Message-ID
- <xmqqjzkaanr1.fsf@gitster.g>
- In-Reply-To
- <015b01da9d5b$bbe59120$33b0b360$@nexbridge.com>
<rsbecker@nexbridge.com> writes:
Show 9 quoted lines
>>> +DEPRECATED MODES >>> +---------------- >>> + >>> +The following modes have been deprecated in favor of subcommands. It >>> +is recommended to migrate to the new syntax. >>> + >>> +-l:: >>> +--list:: >>> + Replaced by `git config list`.
Can you trim quotes in your response that has no relevance to what you are responding to?
> Removing the --list option is going to break backward > compatibility for users who script the use of config for things > like setup, clone automation, etc.
Yes, that is why this is merely a deprecation.
> Adding list as a sub-command could (but should not) cause > ambiguities between a list and configuration value.
Because there is no sectionless variable, there exists no ambiguity.
In other words,
$ git config list
cannot be asking for the value of the variable "list", because such a variable cannot exist. When you start your command with
$ git config list ...
whatever other tokens follow that token "list" on the command line, it is a "--list" subcommand. A traditional and lazy "get a single variable" without an explicit subcommand would look like
$ git config section.variable
that is a short-hand to
$ git config --get section.variable
and would become
$ git config get section.variable
in the new world order.
Thanks.