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

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

From
Yukai Chou <muzimuzhi@gmail.com>
Date
Aug 21, 2024, 08:10 UTC
Message-ID
<CAEg0tHTWzgD5bw3oK7-Rtv9oTymqyhvZz3bcJ7yNRhF8wXMLGA@mail.gmail.com>
The v2.46.0 doc of git-config(1) says
> --name-only
> Output only the names of config variables for `list` or `get`.
https://git-scm.com/docs/git-config#Documentation/git-config.txt---name-only

But the behavior of --name-only is more like "disable non-name outputs and leave the output state of names as-is". Thus using --name-only alone, one gets totally empty lines (which might be weird); only using --name-only and --show-names together, can one get output of just names.

# 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.
Yukai Chou
Next: Junio C Hamano
Message 1 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.