From: Junio C Hamano <gitster@pobox.com>
To: Victoria Dye <vdye@github.com>
Cc: "William Sprent via GitGitGadget" <gitgitgadget@gmail.com>,
git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"William Sprent" <williams@unity3d.com>,
"Derrick Stolee" <derrickstolee@github.com>,
"Elijah Newren" <newren@gmail.com>
Subject: Re: [PATCH v2] dir: check for single file cone patterns
Date: Thu, 05 Jan 2023 11:16:22 +0900 [thread overview]
Message-ID: <xmqq5ydlu3nt.fsf@gitster.g> (raw)
In-Reply-To: <99e3c0f9-ecfa-7c26-eea5-685bc324f674@github.com> (Victoria Dye's message of "Wed, 4 Jan 2023 18:48:24 -0500")
Victoria Dye <vdye@github.com> writes:
> This clearly explains the issue you're trying to fix: cone mode
> sparse-checkout requires patterns like '/A/B/', !/A/B/*/', '/A/B/C/', etc.,
> but invalid patterns like '/A/B/C' (no trailing slash) currently don't force
> the switch to non-cone mode, leading to unexpected behavior.
> ...
>> To fix these issues, add a cone mode pattern check that asserts that
>> every pattern is either a directory match or the pattern '/*'. Add a
>> test to verify the new pattern check and modify another to reflect that
>> non-directory patterns are caught earlier.
>
> I think this is the best way to maintain the current intended behavior of
> cone mode sparse-checkout. While the idea of single file "exceptions" to
> cone patterns has been brought up in the past (I think most recently at the
> Contributor's Summit this past September [1]), it'd be a substantial change
> that's definitely out-of-scope of this small bugfix.
> ...
> And this test ensures the new check is working for the appropriate patterns.
>
> This patch looks good to me, thanks for finding & fixing the bug!
Thanks for an excellently written review, and a patch that is well
done.
Will queue.
next prev parent reply other threads:[~2023-01-05 2:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 14:27 [PATCH] dir: check for single file cone patterns William Sprent via GitGitGadget
2022-12-20 14:33 ` Ævar Arnfjörð Bjarmason
2022-12-21 12:51 ` William Sprent
2023-01-03 8:20 ` [PATCH v2] " William Sprent via GitGitGadget
2023-01-04 6:07 ` Junio C Hamano
2023-01-04 23:48 ` Victoria Dye
2023-01-05 2:16 ` Junio C Hamano [this message]
2023-01-05 11:39 ` William Sprent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5ydlu3nt.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=newren@gmail.com \
--cc=vdye@github.com \
--cc=williams@unity3d.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).