git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] `git clone '-c KEY=VALUE'` no longer works

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 24, 2025, 21:19 UTC
Message-ID
<xmqq8qfvw2lh.fsf@gitster.g>
In-Reply-To
<CALnO6CBJppT3ELyu54rJvP+uqcMomJS9Nr_JTgfssn8iqG7MWA@mail.gmail.com>
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
Show 16 quoted lines
> 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.
Previous: D. Ben KnobleNext: Jeff King
Message 3 of 14 in “[BUG] `git clone '-c KEY=VALUE'` no longer works”
  1. Ran Ari-GurNov 24, 2025
  2. D. Ben KnobleNov 24, 2025
  3. Junio C HamanoNov 24, 2025
  4. Jeff KingNov 24, 2025
  5. Junio C HamanoNov 25, 2025
  6. Junio C HamanoNov 25, 2025
  7. Jeff KingNov 26, 2025
  8. Junio C HamanoNov 26, 2025
  9. Jeff KingNov 30, 2025
  10. Junio C HamanoNov 30, 2025
  11. Jeff KingNov 26, 2025
  12. Junio C HamanoNov 26, 2025
  13. Jeff KingNov 24, 2025
  14. Johannes SchindelinNov 25, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.