Re: Inconsistent/buggy behaviour of "git config --add"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024-03-24 at 18:57:21, Tim Landscheidt wrote:
> Junio C Hamano <gitster@xxxxxxxxx> 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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux