[BUG] `git clone '-c KEY=VALUE'` no longer works
- From
- Ran Ari-Gur <ran.arigur+git@samsara.com>
- Date
- Nov 24, 2025, 05:23 UTC
- Message-ID
- <CAN1UxBvk_GJjLWd0XexRxp8FFhYozGCNcodai0eqnjrhjKEh7Q@mail.gmail.com>
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 filebecause 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