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