Thread (2 messages) flat view 2 messages, 2 authors, 2025-11-30

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

From: Junio C Hamano <hidden>
Date: 2025-11-26 17:06:48

Jeff King [off-list ref] writes:
That doesn't trigger via "git -c", because we use the "new" form these
days (so it started rejecting the extra whitespace in 2021). And you'd
only see it if you hand-crafted the variable, or an old version of Git
set parameters that were then parsed by a newer one.

So whether that is a case we care about is up for debate. But if we are
going to accommodate backwards compatibility, we have to decide where to
draw the line.
I was hoping we already drew the line above the "clone" thing ;-)
The old code actually trimmed both sides. So:

  $ GIT_CONFIG_PARAMETERS="'foo.bar =baz'" git.v2.51.0 config foo.bar
  baz

  $ GIT_CONFIG_PARAMETERS="'foo.bar =baz'" git.v2.52.0 config foo.bar
  error: invalid key: foo.bar
  fatal: unable to parse command-line config

And I think the latter would still fail with your patch. Again, that
might not matter to us, if all we care about is making:

  git clone '-c foo.bar=baz' ...

work as before. But I'm still skeptical that is worthwhile (especially
given that nobody noticed the same change to "git -c" a few years ago).
True.

I do not think I can convince myself to care about this deeply
enough.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help