git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* builtin/config: --name-only doesn't imply --show-names in "git config get"
@ 2024-08-21  8:10 Yukai Chou
  2024-08-21 16:06 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Yukai Chou @ 2024-08-21  8:10 UTC (permalink / raw)
  To: git; +Cc: ps

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-22 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21  8:10 builtin/config: --name-only doesn't imply --show-names in "git config get" Yukai Chou
2024-08-21 16:06 ` Junio C Hamano
2024-08-21 20:28   ` Yukai Chou
2024-08-21 20:59     ` Junio C Hamano
2024-08-22  5:57       ` Patrick Steinhardt
2024-08-22 14:54         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).