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

Re: [PATCH v4 00/10] Sparse index: delete ignored files outside sparse cone

From
Elijah Newren <newren@gmail.com>
Date
Aug 27, 2021, 22:01 UTC
Message-ID
<CABPp-BH2+Vq4gLnOyRg4AdNhZgZuFf5+XBW6JMmSzGxoppEctA@mail.gmail.com>
In-Reply-To
<CABPp-BG01tXnd_UhYJDX4Tm_EcXGju9CkB8BXU0XS-YAWEuaeQ@mail.gmail.com>
Sorry, one more thing...
On Fri, Aug 27, 2021 at 2:56 PM Elijah Newren <newren@gmail.com> wrote:
>
> On Tue, Aug 24, 2021 at 2:51 PM Derrick Stolee via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
Show 16 quoted lines
> >   8:  febef675f05 !  9:  c19d93ec5d7 sparse-checkout: clear tracked sparse dirs
> >      @@ Commit message
> >           the sparse directory. This depends on the indexed version of the file,
> >           so the sparse directory must be expanded.
> >
> >      +    We must take special care to look for untracked, non-ignored files in
> >      +    these directories before deleting them. We do not want to delete any
> >      +    meaningful work that the users were doing in those directories and
> >      +    perhaps forgot to add and commit before switching sparse-checkout
> >      +    definitions. Since those untracked files might be code files that
> >      +    generated ignored build output, also do not delete any ignored files
> >      +    from these directories in that case. The users can recover their state
> >      +    by resetting their sparse-checkout definition to include that directory
> >      +    and continue. Alternatively, they can see the warning that is presented
> >      +    and delete the directory themselves to regain the performance they
> >      +    expect.

Will deleting the directory regain the performance they expect, or is another step needed? In other worse, will the sparsification of the paths under the no-longer-needed directory into a sparse directory entry just happen automatically as part of some other command like commit/add, or do they need to manually run `git sparse-checkout reapply`?

Show 24 quoted lines
> >      +
> >           By deleting the sparse directories when changing scope (or running 'git
> >           sparse-checkout reapply') we regain these performance benefits as if the
> >           repository was in a clean state.
> >      @@ Documentation/git-sparse-checkout.txt: case-insensitive check. This corrects for
> >        'git sparse-checkout set' command to reflect the expected cone in the working
> >        directory.
> >
> >      -+The cone mode sparse-checkout patterns will also remove ignored files that
> >      -+are not within the sparse-checkout definition. This is important behavior
> >      -+to preserve the performance of the sparse index, but also matches that
> >      -+cone mode patterns care about directories, not files. If there exist files
> >      -+that are untracked and not ignored, then Git will not delete files within
> >      -+that directory other than the tracked files that are now out of scope.
> >      -+These files should be removed manually to ensure Git can behave optimally.
> >      ++When changing the sparse-checkout patterns in cone mode, Git will inspect each
> >      ++tracked directory that is not within the sparse-checkout cone to see if it
> >      ++contains any untracked files. If all of those files are ignored due to the
> >      ++`.gitignore` patterns, then the directory will be deleted. If any of the
> >      ++untracked files within that directory is not ignored, then no deletions will
> >      ++occur within that directory and a warning message will appear. If these files
> >      ++are important, then reset your sparse-checkout definition so they are included,
> >      ++use `git add` and `git commit` to store them, then remove any remaining files
> >      ++manually to ensure Git can behave optimally.
Previous: Elijah NewrenNext: Derrick Stolee
Message 73 of 92 in “Sparse index: delete ignored files outside sparse cone”
  1. 0/2 Sparse index: delete ignored files outside sparse coneDerrick Stolee via GitGitGadget, Jul 29, 2021
  2. 1/2 t7519: rewrite sparse index testDerrick Stolee via GitGitGadget, Jul 29, 2021
  3. 2/2 sparse-checkout: clear tracked sparse dirsDerrick Stolee via GitGitGadget, Jul 29, 2021
  4. Elijah NewrenJul 30, 2021
  5. Derrick StoleeAug 2, 2021
  6. Elijah NewrenAug 2, 2021
  7. Derrick StoleeAug 5, 2021
  8. Elijah NewrenAug 5, 2021
  9. Elijah NewrenJul 30, 2021
  10. 0/8 Sparse index: delete ignored files outside sparse coneDerrick Stolee via GitGitGadget, Aug 10, 2021
  11. 1/8 t7519: rewrite sparse index testDerrick Stolee via GitGitGadget, Aug 10, 2021
  12. 2/8 sparse-index: silently return when not using cone-mode patternsDerrick Stolee via GitGitGadget, Aug 10, 2021
  13. 3/8 sparse-index: silently return when cache tree failsDerrick Stolee via GitGitGadget, Aug 10, 2021
  14. Elijah NewrenAug 19, 2021
  15. Derrick StoleeAug 20, 2021
  16. 4/8 unpack-trees: fix nested sparse-dir searchDerrick Stolee via GitGitGadget, Aug 10, 2021
  17. 5/8 sparse-checkout: create helper methodsDerrick Stolee via GitGitGadget, Aug 10, 2021
  18. Derrick StoleeAug 12, 2021
  19. 6/8 attr: be careful about sparse directoriesDerrick Stolee via GitGitGadget, Aug 10, 2021
  20. 7/8 sparse-index: add SPARSE_INDEX_IGNORE_CONFIG flagDerrick Stolee via GitGitGadget, Aug 10, 2021
  21. 8/8 sparse-checkout: clear tracked sparse dirsDerrick Stolee via GitGitGadget, Aug 10, 2021
  22. 0/8 Sparse index: delete ignored files outside sparse coneDerrick Stolee via GitGitGadget, Aug 17, 2021
  23. 2/8 sparse-index: silently return when not using cone-mode patternsDerrick Stolee via GitGitGadget, Aug 17, 2021
  24. 1/8 t7519: rewrite sparse index testDerrick Stolee via GitGitGadget, Aug 17, 2021
  25. Johannes SchindelinAug 19, 2021
  26. Derrick StoleeAug 20, 2021
  27. Eric SunshineAug 20, 2021
  28. 3/8 sparse-index: silently return when cache tree failsDerrick Stolee via GitGitGadget, Aug 17, 2021
  29. 5/8 sparse-checkout: create helper methodsDerrick Stolee via GitGitGadget, Aug 17, 2021
  30. Johannes SchindelinAug 19, 2021
  31. Derrick StoleeAug 20, 2021
  32. 4/8 unpack-trees: fix nested sparse-dir searchDerrick Stolee via GitGitGadget, Aug 17, 2021
  33. Johannes SchindelinAug 19, 2021
  34. Derrick StoleeAug 20, 2021
  35. René ScharfeAug 20, 2021
  36. René ScharfeAug 20, 2021
  37. Elijah NewrenAug 19, 2021
  38. 8/8 sparse-checkout: clear tracked sparse dirsDerrick Stolee via GitGitGadget, Aug 17, 2021
  39. Johannes SchindelinAug 19, 2021
  40. Derrick StoleeAug 20, 2021
  41. Elijah NewrenAug 20, 2021
  42. Elijah NewrenAug 20, 2021
  43. Johannes SchindelinAug 23, 2021
  44. 7/8 sparse-index: add SPARSE_INDEX_IGNORE_CONFIG flagDerrick Stolee via GitGitGadget, Aug 17, 2021
  45. Derrick StoleeAug 18, 2021
  46. 6/8 attr: be careful about sparse directoriesDerrick Stolee via GitGitGadget, Aug 17, 2021
  47. Johannes SchindelinAug 19, 2021
  48. Derrick StoleeAug 20, 2021
  49. Elijah NewrenAug 19, 2021
  50. Derrick StoleeAug 20, 2021
  51. Elijah NewrenAug 20, 2021
  52. Elijah NewrenAug 17, 2021
  53. 00/10 Sparse index: delete ignored files outside sparse coneDerrick Stolee via GitGitGadget, Aug 24, 2021
  54. 01/10 t7519: rewrite sparse index testDerrick Stolee via GitGitGadget, Aug 24, 2021
  55. 02/10 sparse-index: silently return when not using cone-mode patternsDerrick Stolee via GitGitGadget, Aug 24, 2021
  56. 03/10 sparse-index: silently return when cache tree failsDerrick Stolee via GitGitGadget, Aug 24, 2021
  57. 04/10 sparse-index: use WRITE_TREE_MISSING_OKDerrick Stolee via GitGitGadget, Aug 24, 2021
  58. Elijah NewrenAug 27, 2021
  59. Derrick StoleeAug 30, 2021
  60. Elijah NewrenAug 30, 2021
  61. 05/10 unpack-trees: fix nested sparse-dir searchDerrick Stolee via GitGitGadget, Aug 24, 2021
  62. René ScharfeAug 24, 2021
  63. Derrick StoleeAug 25, 2021
  64. 06/10 sparse-checkout: create helper methodsDerrick Stolee via GitGitGadget, Aug 24, 2021
  65. 07/10 attr: be careful about sparse directoriesDerrick Stolee via GitGitGadget, Aug 24, 2021
  66. 08/10 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flagDerrick Stolee via GitGitGadget, Aug 24, 2021
  67. 09/10 sparse-checkout: clear tracked sparse dirsDerrick Stolee via GitGitGadget, Aug 24, 2021
  68. 10/10 sparse-checkout: add config to disable deleting dirsDerrick Stolee via GitGitGadget, Aug 24, 2021
  69. Elijah NewrenAug 27, 2021
  70. Derrick StoleeAug 30, 2021
  71. Elijah NewrenAug 30, 2021
  72. Elijah NewrenAug 27, 2021
  73. Elijah NewrenAug 27, 2021
  74. Derrick StoleeAug 30, 2021
  75. Elijah NewrenAug 30, 2021
  76. Derrick StoleeAug 30, 2021
  77. Elijah NewrenAug 30, 2021
  78. 0/9 Sparse index: delete ignored files outside sparse coneDerrick Stolee via GitGitGadget, Sep 8, 2021
  79. 1/9 t7519: rewrite sparse index testDerrick Stolee via GitGitGadget, Sep 8, 2021
  80. 2/9 sparse-index: silently return when not using cone-mode patternsDerrick Stolee via GitGitGadget, Sep 8, 2021
  81. 3/9 unpack-trees: fix nested sparse-dir searchDerrick Stolee via GitGitGadget, Sep 8, 2021
  82. 5/9 sparse-index: use WRITE_TREE_MISSING_OKDerrick Stolee via GitGitGadget, Sep 8, 2021
  83. 4/9 sparse-index: silently return when cache tree failsDerrick Stolee via GitGitGadget, Sep 8, 2021
  84. 6/9 sparse-checkout: create helper methodsDerrick Stolee via GitGitGadget, Sep 8, 2021
  85. 7/9 attr: be careful about sparse directoriesDerrick Stolee via GitGitGadget, Sep 8, 2021
  86. 8/9 sparse-index: add SPARSE_INDEX_MEMORY_ONLY flagDerrick Stolee via GitGitGadget, Sep 8, 2021
  87. 9/9 sparse-checkout: clear tracked sparse dirsDerrick Stolee via GitGitGadget, Sep 8, 2021
  88. Junio C HamanoSep 8, 2021
  89. Junio C HamanoSep 8, 2021
  90. Derrick StoleeSep 8, 2021
  91. Junio C HamanoSep 8, 2021
  92. Elijah NewrenSep 8, 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.