git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 16 of 18 in “Allowing "/" in the name of a git remote is a strange choice”
  1. Per CederqvistJul 3, 2025
  2. Junio C HamanoJul 4, 2025
  3. Patrick SteinhardtJul 4, 2025
  4. Lidong YanJul 4, 2025
  5. Lidong YanJul 4, 2025
  6. Junio C HamanoJul 4, 2025
  7. Per CederqvistJul 4, 2025
  8. Jeff KingJul 5, 2025
  9. remote: detect collisions in remote namesJeff King, Jul 5, 2025
  10. Patrick SteinhardtJul 7, 2025
  11. Jeff KingJul 7, 2025
  12. Junio C HamanoJul 7, 2025
  13. Jeff KingJul 8, 2025
  14. Jeff KingJul 8, 2025
  15. Junio C HamanoJul 8, 2025
  16. Jeff KingJul 9, 2025
  17. Junio C HamanoJul 7, 2025
  18. Raymond E. PascoJul 9, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.