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

Re: Unexpected (bug-like) behavior in `git ls-remote` matching.

From
Jeff King <peff@peff.net>
Date
Feb 9, 2023, 13:15 UTC
Message-ID
<Y+Tx3Z45SlMJqDfh@coredump.intra.peff.net>
In-Reply-To
<xmqq357gt5s9.fsf@gitster.g>
On Wed, Feb 08, 2023 at 09:40:06AM -0800, Junio C Hamano wrote:
Show 12 quoted lines
> > Likewise, something more elaborate like full-path globbing or even
> > regex matching would be possible, but would need to be activated by an
> > option.
> 
> True.  We should be able to do a bit better than just tail-matching
> with an option.
> 
> I would not recommend sending over regex as protocol capability the
> same way as ref-prefix works, unless we adopt something that can
> match linear-time like re2 and use it everywhere, as you can send a
> pattern that is deliberately made inefficient to inconvenience the
> other side.

Yeah, I should not even have mentioned regex. It was really meant as "if you really wanted to go wild, you could do something as crazy as regexes". But I agree that we would never want to pass regexes over the wire. If we want to make things more efficient, prefix-matching is the way. If we want to make things more ergonomic for the client-side user, then we should stick to globbing (which we already do, but we could do things like full-string globs rather than strict tail-matching).

But I would hold off on all of that until somebody has a concrete case that shows why their preferred matching scheme is useful.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 16 in “Unexpected (bug-like) behavior in `git ls-remote` matching.”
  1. William BlevinsFeb 7, 2023
  2. Junio C HamanoFeb 8, 2023
  3. William BlevinsFeb 8, 2023
  4. Philip OakleyFeb 8, 2023
  5. Jeff KingFeb 8, 2023
  6. Jeff KingFeb 8, 2023
  7. Junio C HamanoFeb 8, 2023
  8. Junio C HamanoFeb 8, 2023
  9. Jeff KingFeb 9, 2023
  10. Junio C HamanoFeb 9, 2023
  11. Jeff KingFeb 11, 2023
  12. 1/2 doc/ls-remote: cosmetic cleanups for examplesJeff King, Feb 11, 2023
  13. 2/2 doc/ls-remote: clarify pattern formatJeff King, Feb 11, 2023
  14. Junio C HamanoFeb 11, 2023
  15. 2/2 doc/ls-remote: clarify pattern formatJeff King, Feb 11, 2023
  16. Ævar Arnfjörð BjarmasonFeb 8, 2023

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.