From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Patrick Steinhardt <ps@pks.im>,
Per Cederqvist <ceder@lysator.liu.se>,
git@vger.kernel.org
Subject: Re: [PATCH] remote: detect collisions in remote names
Date: Tue, 8 Jul 2025 21:21:34 -0400 [thread overview]
Message-ID: <20250709012134.GA1185474@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq5xg2s1n8.fsf@gitster.g>
On Tue, Jul 08, 2025 at 04:28:43PM -0700, Junio C Hamano wrote:
> > [trailing underscore: mostly a_, b_ in comparators]
> > $ git grep 'void \*[a-zA-Z0-9]_' '*.c' | wc -l
> > 30
>
> Only a single letter followed by an underscore, which may be
> followed by more letters legal in names (like a_bcde)?
>
> A more fair pattern may be something like
>
> $ git grep 'void \*[A-Za-z_0-9]*_[^A-Za-z_0-9]' \*.c | wc -l
> 52
Doh, yeah. No wonder it mostly found "a_" and "b_". ;) Yours is a much
better pattern.
> > Although I think we're all a bit lukewarm on the concept, I feel like it
> > won't hurt anything, isn't too much code, and disables a potential (if
> > somewhat rare) footgun. So probably worth doing?
>
> Even though it does not cover all cases, at least those coming from
> "git remote" will be able to avoid surprises, so let me replace with
> this version, wait for a few days for more inputs from others and
> then mark it for 'next' if nobody sees any downsides.
Sounds good, thanks.
-Peff
next prev parent reply other threads:[~2025-07-09 1:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 19:33 Allowing "/" in the name of a git remote is a strange choice Per Cederqvist
2025-07-04 4:51 ` Junio C Hamano
2025-07-04 5:13 ` Patrick Steinhardt
2025-07-04 8:10 ` Lidong Yan
2025-07-04 8:17 ` Lidong Yan
2025-07-04 14:18 ` Junio C Hamano
2025-07-04 6:42 ` Per Cederqvist
2025-07-05 16:57 ` Jeff King
2025-07-05 18:58 ` [PATCH] remote: detect collisions in remote names Jeff King
2025-07-07 9:14 ` Patrick Steinhardt
2025-07-07 20:28 ` Jeff King
2025-07-07 21:04 ` Junio C Hamano
2025-07-08 22:59 ` Jeff King
2025-07-08 23:02 ` Jeff King
2025-07-08 23:28 ` Junio C Hamano
2025-07-09 1:21 ` Jeff King [this message]
2025-07-07 13:59 ` Junio C Hamano
2025-07-09 11:56 ` Raymond E. Pasco
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=20250709012134.GA1185474@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=ceder@lysator.liu.se \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ps@pks.im \
/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).