From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "D. Ben Knoble" <ben.knoble@gmail.com>,
Ran Ari-Gur <ran.arigur+git@samsara.com>,
git@vger.kernel.org, "raa.lkml@gmail.com" <raa.lkml@gmail.com>
Subject: Re: [BUG] `git clone '-c KEY=VALUE'` no longer works
Date: Mon, 24 Nov 2025 17:27:01 -0800 [thread overview]
Message-ID: <xmqqo6oqucka.fsf@gitster.g> (raw)
In-Reply-To: <20251124235530.GC2051672@coredump.intra.peff.net> (Jeff King's message of "Mon, 24 Nov 2025 18:55:30 -0500")
Jeff King <peff@peff.net> writes:
> I was surprised that a single "-c foo" argument would work, but it makes
> sense: it is the "stuck" form of the short option "-c". So:
>
> git cmd -cfoo
>
> should be the equivalent of:
>
> git cmd -c foo
>
> whenever "-c" takes an option. It is just surprising to read because of
> the leading space in the value.
Ahh, OK, so
git cmd '-c foo.bar=baz'
was doing
git cmd --config=' foo.bar=baz'
or an easier-to-read form to express in the "stuck" form of the
short option
git cmd -c' foo.bar=baz'
which I totally missed. I agree that the option parser is doing the
right thing for that case, including passing " foo=bar" with a
leading space as its value.
> So yes, we did allow that until recently, along with:
>
> git clone -c ' foo.bar = baz'
>
> which keeps the space in the value "baz", but otherwise sets foo.bar.
>
> I agree it was certainly surprising. Despite the real-world report that
> started this thread, it is oddball enough that I do not think we want to
> continue supporting it even for historical reasons. It is not quite at
> the level of https://xkcd.com/1172/, but especially the form that the OP
> showed looks like a mistaken invocation that happened to work (and would
> not work for any other option in general).
After you explained the "that's stuck form with leading whitespace
in the value" I missed, I wasn't so sure. "The value is supposed to
be a configuration variable, followed by an equal sign, followed by
its value; what good does it do if we retained the leading
whitespace---stripping is a usability feature" would work as an
argument in this particular case, even though it may not work in
general. Of course, the right thing to do when "git clone -c"
option was introduced would have been to notice that the stripping
of spaces is unwelcome complication of the UI and reject/correct it,
but it is way too late for that now.
The right right thing to do at this point may be to fix the
regression and at the same time mark the "feature" as deprecated,
and remove it following the usual deprecation procedure, but that
certainly sounds like an unnecessary waste of engineering effort.
So, I dunno.
next prev parent reply other threads:[~2025-11-25 1:27 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
2025-11-24 23:55 ` Jeff King
2025-11-25 1:27 ` Junio C Hamano [this message]
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=xmqqo6oqucka.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).