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

Re: [PATCH v2] dir: check for single file cone patterns

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 5, 2023, 02:16 UTC
Message-ID
<xmqq5ydlu3nt.fsf@gitster.g>
In-Reply-To
<99e3c0f9-ecfa-7c26-eea5-685bc324f674@github.com>
Victoria Dye <vdye@github.com> writes:
Show 19 quoted lines
> 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.
Previous: Victoria DyeNext: William Sprent
Message 7 of 8 in “dir: check for single file cone patterns”
  1. dir: check for single file cone patternsWilliam Sprent via GitGitGadget, Dec 20, 2022
  2. Ævar Arnfjörð BjarmasonDec 20, 2022
  3. William SprentDec 21, 2022
  4. dir: check for single file cone patternsWilliam Sprent via GitGitGadget, Jan 3, 2023
  5. Junio C HamanoJan 4, 2023
  6. Victoria DyeJan 4, 2023
  7. Junio C HamanoJan 5, 2023
  8. William SprentJan 5, 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.