From: Patrick Steinhardt <ps@pks.im>
To: Tim Landscheidt <tim@tim-landscheidt.de>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Inconsistent/buggy behaviour of "git config --add"
Date: Mon, 25 Mar 2024 08:28:40 +0100 [thread overview]
Message-ID: <ZgEnqE23PYVCNeKc@tanuki> (raw)
In-Reply-To: <87o7b3xxta.fsf@vagabond.tim-landscheidt.de>
[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]
On Sun, Mar 24, 2024 at 06:57:21PM +0000, Tim Landscheidt wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
[snip]
> >> My expectation of least surprise is that "git config
> >> section.key --add value" should be equivalent to "git config
> >> --add section.key value".
>
> > You cannot have "--add" as a value by doing so.
>
> > […]
>
> The standard way to achieve this would be to use "--",
> i. e. "git config section.key --add -- --add" (apparently
> even part of POSIX as "Utility Syntax Guidelines", but also
> commonly used elsewhere in Git).
I think the whole design of git-config(1) is just not great, and I'm not
surprised at all that folks run into issues like the one you describe
here. I agree that it is quite surprising that modes like "--add" look
like a flag, but don't really behave like one in the general case.
This is part of the reason why I have recently proposed to convert this
command to use proper subcommands [1]. This introduces things like `git
config set`, `git config list`, `git config get`, `git config unset`
that (in my opinion) behave a lot more obvious. Also, I certainly agree
with you that those subcommands should respect "--" as many other of our
Git commands already do.
I plan to reroll this patch series soonish. Please feel free to provide
your feedback on it so that we can iterate on the proposed UI/UX and
make it match user's expectations better.
Patrick
[1]: https://lore.kernel.org/git/cover.1710198711.git.ps@pks.im/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-03-25 7:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-23 16:07 Inconsistent/buggy behaviour of "git config --add" Tim Landscheidt
2024-03-23 17:52 ` Junio C Hamano
2024-03-24 18:57 ` Tim Landscheidt
2024-03-25 0:31 ` brian m. carlson
2024-03-25 7:28 ` Patrick Steinhardt [this message]
2024-03-25 18:56 ` 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=ZgEnqE23PYVCNeKc@tanuki \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tim@tim-landscheidt.de \
/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).