From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 82BB01F5A0 for ; Thu, 9 Feb 2023 13:16:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230076AbjBINPv (ORCPT ); Thu, 9 Feb 2023 08:15:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbjBINPr (ORCPT ); Thu, 9 Feb 2023 08:15:47 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D6B15EBFC for ; Thu, 9 Feb 2023 05:15:26 -0800 (PST) Received: (qmail 659 invoked by uid 109); 9 Feb 2023 13:15:10 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 09 Feb 2023 13:15:10 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 12902 invoked by uid 111); 9 Feb 2023 13:15:10 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 09 Feb 2023 08:15:10 -0500 Authentication-Results: peff.net; auth=none Date: Thu, 9 Feb 2023 08:15:09 -0500 From: Jeff King To: Junio C Hamano Cc: William Blevins , git@vger.kernel.org Subject: Re: Unexpected (bug-like) behavior in `git ls-remote` matching. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Feb 08, 2023 at 09:40:06AM -0800, Junio C Hamano wrote: > > 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