From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id EF4FB1F466 for ; Tue, 14 Jan 2020 21:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728765AbgANVVW (ORCPT ); Tue, 14 Jan 2020 16:21:22 -0500 Received: from cloud.peff.net ([104.130.231.41]:36564 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728748AbgANVVV (ORCPT ); Tue, 14 Jan 2020 16:21:21 -0500 Received: (qmail 10236 invoked by uid 109); 14 Jan 2020 21:21:21 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Tue, 14 Jan 2020 21:21:21 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 25412 invoked by uid 111); 14 Jan 2020 21:27:36 -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; Tue, 14 Jan 2020 16:27:36 -0500 Authentication-Results: peff.net; auth=none Date: Tue, 14 Jan 2020 16:21:20 -0500 From: Jeff King To: Derrick Stolee via GitGitGadget Cc: git@vger.kernel.org, me@ttaylorr.com, newren@gmail.com, Derrick Stolee Subject: Re: [PATCH 7/8] sparse-checkout: properly match escaped characters Message-ID: <20200114212120.GC3949560@coredump.intra.peff.net> References: <09dbe1f9029d173e579b74442b02bc20e1a82437.1579029963.git.gitgitgadget@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <09dbe1f9029d173e579b74442b02bc20e1a82437.1579029963.git.gitgitgadget@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Jan 14, 2020 at 07:26:01PM +0000, Derrick Stolee via GitGitGadget wrote: > From: Derrick Stolee > > In cone mode, the sparse-checkout feature uses hashset containment > queries to match paths. Make this algorithm respect escaped asterisk > (*) and backslash (\) characters. > > Create dup_and_filter_pattern() method to convert a pattern by > removing escape characters and dropping an optional "/*" at the end. > This method is available in dir.h as we will use it in > builtin/sparse-chekcout.c in a later change. s/chekcout/checkout/ It took me a minute to understand the problem here, but I think it's: if a path in the sparse-checkout file has "\*" in it, we'd try to match a literal "\*" in the hash, not "*"? But we wouldn't run into that yet because we don't properly _write_ the escaped names until patch 8. Is that right? -Peff