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

Re: Memory leak with sparse-checkout

From
Taylor Blau <me@ttaylorr.com>
Date
Sep 20, 2021, 16:42 UTC
Message-ID
<YUi55/3L9nizTVyA@nand.local>
In-Reply-To
<8a0ddd8e-b585-8f40-c4b1-0a51f11e6b84@gmail.com>
On Mon, Sep 20, 2021 at 12:29:36PM -0400, Derrick Stolee wrote:
Show 16 quoted lines
> > So I think the problem really is that we need to drop existing patterns
> > when re-initializing the sparse-checkout in cone mode. We could try to
> > recognize that existing patterns may already constitute a cone (and/or
> > create a cone that covers the existing patterns).
> >
> > But I think the easiest thing (if a little unfriendly) would be to just
> > drop them and start afresh when re-initializing the sparse-checkout in
> > cone mode.
>
> This isn't sufficient, as a user can modify their .git/info/sparse-checkout
> file whenever they want, so we should fix this bug regardless. We could add
> a "Your existing patterns are not in cone mode" error.
>
> It might still be a good idea to let "git sparse-checkout init --cone"
> overwrite the sparse-checkout file _if the file is not already in cone
> mode_.

I'm not sure how helpful such an error message might be to a user in this scenario without extra information. After seeing just "this isn't a cone", it's not clear what they should do other than drop their sparse-checkout configuration and start over.

It would be nice to have an intermediate step between seeing realizing that the existing patterns don't form a cone and dropping them.

Perhaps we could include an error message and say something like:
    warning: your sparse-checkout patterns do not from a cone
       hint: to reinitialize your sparse-checkout configuration
       hint: try running:
       hint:
       hint:   git sparse-checkout init --cone --reinitialize

Where `--reinitialize` means to drop existing patterns. I suppose it could be the default when transitioning from non-cone to cone mode, but that would defeat the purpose of the warning.

We would probably want to perform this check both during initialization, and when adding patterns in cone mode. It may also be worthwhile to check the validity of the cone before running 'list' or 'reapply', too.

Thanks, Taylor

Previous: Derrick StoleeNext: Derrick Stolee
Message 4 of 15 in “Memory leak with sparse-checkout”
  1. CalbabreakerSep 20, 2021
  2. Taylor BlauSep 20, 2021
  3. Derrick StoleeSep 20, 2021
  4. Taylor BlauSep 20, 2021
  5. Derrick StoleeSep 20, 2021
  6. Derrick StoleeSep 20, 2021
  7. Taylor BlauSep 20, 2021
  8. Derrick StoleeSep 20, 2021
  9. Taylor BlauSep 20, 2021
  10. Derrick StoleeSep 21, 2021
  11. Taylor BlauSep 21, 2021
  12. Derrick StoleeSep 21, 2021
  13. Taylor BlauSep 21, 2021
  14. Derrick StoleeSep 22, 2021
  15. Taylor BlauSep 22, 2021

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.