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

Re: Memory leak with sparse-checkout

From
Derrick Stolee <stolee@gmail.com>
Date
Sep 20, 2021, 20:56 UTC
Message-ID
<427c6d86-f123-035e-b0e6-4a21598ed111@gmail.com>
In-Reply-To
<YUjcMu7Z094eaFRA@nand.local>
On 9/20/2021 3:08 PM, Taylor Blau wrote:
Show 20 quoted lines
> On Mon, Sep 20, 2021 at 01:27:25PM -0400, Derrick Stolee wrote:
>> On 9/20/2021 1:25 PM, Derrick Stolee wrote:
>>> On 9/20/2021 12:42 PM, Taylor Blau wrote:
>>>> 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.
>>>
>>> 'list' definitely seems like a good idea, since it is expecting different
>>> output than the literal patterns when cone mode is enabled.
>>
>> I double-checked this to see how to fix this, and the 'list' subcommand
>> already notices that the patterns are not in cone mode and reverts its
>> behavior to writing all of the sparse-checkout file to stdout. It also
>> writes warnings over stderr before that.
>>
>> There might not be anything pressing to do here.
> 
> Hmm. I think we'd probably want the same behavior for init and any other
> commands which could potentially overwrite the contents of the
> sparse-checkout file.
Could you elaborate on what you mean by "the same behavior"?

Do you mean that "git sparse-checkout add X" should act as if cone mode is not enabled if the existing patterns are not cone-mode patterns?

What exactly do you mean about "init" changing behavior here?
 
> Those may already call list routines internally, in which case I agree
> that this is already taken care of. But if not, then I think we should
> match list's behavior in the new locations, too.

"list" interprets the 'struct pattern_list' in two different ways, depending on the use_cone_patterns member. They are static methods in the builtin code, not used by anything else.

Thanks, -Stolee

Previous: Taylor BlauNext: Taylor Blau
Message 8 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.