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

Re: builtin/config: --name-only doesn't imply --show-names in "git config get"

From
Yukai Chou <muzimuzhi@gmail.com>
Date
Aug 21, 2024, 20:28 UTC
Message-ID
<CAEg0tHQVK9hgcHTzn-ZPdwoFbbYFB2joeT0jLQgtD6yEH+1GiA@mail.gmail.com>
In-Reply-To
<xmqqttfd2734.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2024年8月22日周四 00:07写道:
Show 12 quoted lines
>
> Yukai Chou <muzimuzhi@gmail.com> writes:
>
> > # get empty line(s)
> > git config get --all --name-only remote.origin.fetch
> > # get lines of name(s)
> > git config get --all --show-names --name-only remote.origin.fetch
> >
> > Either the doc or the behavior of --name-only needs some adjustment.
>
> This argues for making "all" imply we need to show the name of the
> configuration variable,
Sorry can you elaborate on what that "all" meant? A new option "--show-all"?
> and introducing an option "--hide-name" to
> omit the name.  That way, you'd need to give clearly contradicting
> "--hide-name" and "--name-only" together to get a nonsense output.

I have a feeling that finally a collection of options shared by "git config list" and "git config get" will be introduced to fully control what they output, and even make the form of output given by one of "git config list" and "git config get" look exactly like the other.

An ideal design:

--show-all --[no-]show-scope --[no-]show-origin --[no-]show-name --[no-]show-value --hide-all --separator=<sep> # fuzzy name?

Initial options
- git config list: --hide-all --show-name --show-value --separator="="
- git config get: --hide-all --show-value --separator=" "
The drawback is, quite some combinations of such options are nonsense.
Yukai
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “builtin/config: --name-only doesn't imply --show-names in "git config get"”
  1. Yukai ChouAug 21, 2024
  2. Junio C HamanoAug 21, 2024
  3. Yukai ChouAug 21, 2024
  4. Junio C HamanoAug 21, 2024
  5. Patrick SteinhardtAug 22, 2024
  6. Junio C HamanoAug 22, 2024

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.