git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "D. Ben Knoble" <ben.knoble@gmail.com>
Cc: Ran Ari-Gur <ran.arigur+git@samsara.com>,
	 git@vger.kernel.org,  Jeff King <peff@peff.net>,
	 "raa.lkml@gmail.com" <raa.lkml@gmail.com>
Subject: Re: [BUG] `git clone '-c KEY=VALUE'` no longer works
Date: Mon, 24 Nov 2025 13:19:22 -0800	[thread overview]
Message-ID: <xmqq8qfvw2lh.fsf@gitster.g> (raw)
In-Reply-To: <CALnO6CBJppT3ELyu54rJvP+uqcMomJS9Nr_JTgfssn8iqG7MWA@mail.gmail.com> (D. Ben Knoble's message of "Mon, 24 Nov 2025 11:20:05 -0500")

"D. Ben Knoble" <ben.knoble@gmail.com> writes:

> On Mon, Nov 24, 2025 at 12:23 AM Ran Ari-Gur <ran.arigur+git@samsara.com> wrote:
>>
>> Hi,
>>
>> There's a small regression in Git v2.52.0; it used to be that a command of the
>> form
>>
>>     git clone '-c KEY=VALUE' ...
>>
>> or
>>
>>     git clone '--config= KEY=VALUE' ...
>>
>> would trim whitespace around KEY, making the command equivalent to this:
>>
>>     git clone --config=KEY=VALUE ...

Hmph, as documented in "git help clone",

    `-c` `<key>=<value>`::
    `--config` `<key>=<value>`::
            Set a configuration variable in the newly-created repository;
            this takes effect immediately after the repository is
            initialized, but before the remote history is fetched or any
            files checked out.  The _<key>_ is in the same format as expected by
            linkgit:git-config[1] (e.g., `core.eol=true`).

I do not offhand know if the option really used to behave as the
original report described, but if

	git clone '-c KEY=VALUE'
	git clone '--config KEY=VALUE'

does not complain-and-barf in the first place, I think that is a
bug.  The above option description clearly asks the user to give the
dashed option (either "-c" or "--config") and "<key>=<value>" as two
separate arguments on the command line.

Interestingly, unlike other long options described nearby, we do not
seem to even list "--config=K=V" form, and that is a documentation
bug---other options like "server-option" is described to use "="
after it before its value, and to parse the "--config K=V", the code
uses the same mechanism.

Also, if the user writes

	git clone -c ' KEY=VALUE'
	git clone --config ' KEY=VALUE'

and we behaved as if it were "KEY=VALUE", that is another bug.  As
documented, "key" is in the format as expected by "git config", and
we never allowed leading or trailing whitespaces around the key
names.

So I dunno.

  reply	other threads:[~2025-11-24 21:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24  5:23 [BUG] `git clone '-c KEY=VALUE'` no longer works Ran Ari-Gur
2025-11-24 16:20 ` D. Ben Knoble
2025-11-24 21:19   ` Junio C Hamano [this message]
2025-11-24 23:55     ` Jeff King
2025-11-25  1:27       ` Junio C Hamano
2025-11-25 22:03         ` Junio C Hamano
2025-11-26 15:02           ` Jeff King
2025-11-26 17:06             ` Junio C Hamano
2025-11-30 13:49               ` Jeff King
2025-11-30 18:11                 ` Junio C Hamano
2025-11-26 14:53         ` Jeff King
2025-11-26 17:08           ` Junio C Hamano
2025-11-24 22:57   ` Jeff King
2025-11-25 20:16   ` Johannes Schindelin

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=xmqq8qfvw2lh.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=raa.lkml@gmail.com \
    --cc=ran.arigur+git@samsara.com \
    /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).