From: "brian m. carlson" <sandals@crustytoothpaste.net>
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 00:31:26 +0000 [thread overview]
Message-ID: <ZgDF3uIEYNbawplE@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <87o7b3xxta.fsf@vagabond.tim-landscheidt.de>
[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]
On 2024-03-24 at 18:57:21, Tim Landscheidt wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
> >> 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).
POSIX mandates that all options come before all non-option arguments.
So by that rule, `git config section.key --add value` means that `--add`
is a non-option argument, not the option `--add`.
Certainly some GNU tools do break the rule, and Git begrudgingly allows
it in some cases, but in utilities in general, it isn't allowed. Many
non-Linux OSes and non-GNU tools don't allow options to appear after
non-option arguments at all.
--
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2024-03-25 0:31 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 [this message]
2024-03-25 7:28 ` Patrick Steinhardt
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=ZgDF3uIEYNbawplE@tapette.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.