Re: [PATCH] remote: detect collisions in remote names
- From
Jeff King <peff@peff.net>
- Date
- Jul 9, 2025, 01:21 UTC
- Message-ID
- <20250709012134.GA1185474@coredump.intra.peff.net>
- In-Reply-To
- <xmqq5xg2s1n8.fsf@gitster.g>
On Tue, Jul 08, 2025 at 04:28:43PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> > [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.
Show 8 quoted lines
> > 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