git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] `git clone '-c KEY=VALUE'` no longer works
@ 2025-11-24  5:23 Ran Ari-Gur
  2025-11-24 16:20 ` D. Ben Knoble
  0 siblings, 1 reply; 14+ messages in thread
From: Ran Ari-Gur @ 2025-11-24  5:23 UTC (permalink / raw)
  To: git

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 ...

The relevant code was here:
https://github.com/git/git/blob/v2.51.2/config.c#L649

That functionality was removed in this refactoring commit:
https://github.com/git/git/commit/dcecac2580ef871186fdc4e9efc87815a4ce4c66

As a result, a command like the above will now fail, with an error such as this:

    error: invalid key:  advice.detachedHead=false
    fatal: unable to write parameters to config file

because config keys are not allowed to contain whitespace.

I believe this change was unintentional; it was not mentioned in the commit
message or the release notes.

This probably isn't a common case, and the project where I ran into this issue
has already fixed it on their end (they now pass -c and KEY=VALUE as separate
arguments); but since Git aims to ensure backward-compatibility where possible,
I figured I should report it.

Thanks in advance!
-Ran

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-11-30 18:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).