From: Yukai Chou <muzimuzhi@gmail.com>
To: git@vger.kernel.org
Cc: ps@pks.im
Subject: builtin/config: --name-only doesn't imply --show-names in "git config get"
Date: Wed, 21 Aug 2024 16:10:33 +0800 [thread overview]
Message-ID: <CAEg0tHTWzgD5bw3oK7-Rtv9oTymqyhvZz3bcJ7yNRhF8wXMLGA@mail.gmail.com> (raw)
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 reply other threads:[~2024-08-21 8:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 8:10 Yukai Chou [this message]
2024-08-21 16:06 ` builtin/config: --name-only doesn't imply --show-names in "git config get" 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEg0tHTWzgD5bw3oK7-Rtv9oTymqyhvZz3bcJ7yNRhF8wXMLGA@mail.gmail.com \
--to=muzimuzhi@gmail.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).