Re: [PATCH v3 6/7] sparse-index: point users to new 'clean' action
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Oct 20, 2025, 14:17 UTC
- Message-ID
- <3848ce2c-c2d3-47db-81cb-14e79d3d7f0e@gmail.com>
- In-Reply-To
- <CABPp-BG_TwQRcCp4iCpcDngb3W7rprnX4FHLs4A884BXQVk_eQ@mail.gmail.com>
On 10/7/25 6:53 PM, Elijah Newren wrote:
Show 35 quoted lines
> On Fri, Sep 12, 2025 at 3:30 AM Derrick Stolee via GitGitGadget > <gitgitgadget@gmail.com> wrote: >> >> From: Derrick Stolee <stolee@gmail.com> >> >> In my experience, the most-common reason that the sparse index must >> expand to a full one is because there is some leftover file in a tracked >> directory that is now outside of the sparse-checkout. The new 'git >> sparse-checkout clean' command will find and delete these directories, >> so point users to it when they hit the sparse index expansion advice. >> >> Signed-off-by: Derrick Stolee <stolee@gmail.com> >> --- >> sparse-index.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/sparse-index.c b/sparse-index.c >> index 5634abafaa..5d14795063 100644 >> --- a/sparse-index.c >> +++ b/sparse-index.c >> @@ -32,7 +32,8 @@ int give_advice_on_expansion = 1; >> "Your working directory likely has contents that are outside of\n" \ >> "your sparse-checkout patterns. Use 'git sparse-checkout list' to\n" \ >> "see your sparse-checkout definition and compare it to your working\n" \ >> - "directory contents. Running 'git clean' may assist in this cleanup." >> + "directory contents. Running 'git sparse-checkout clean' may assist\n" \ >> + "in this cleanup." > > Given that you dropped patch 8 and explicitly call out in the > documentation of `git sparse-checkout clean` that it alone is not > sufficient to do the cleanup, should this advice be calling out a > combination of `git sparse-checkout clean` and `git sparse-checkout > reapply` ? (Should it also suggest an order for running those two; I > seem to recall that the order mattered, but can't recall which one > needs to run first or if it is situation dependent.)
I'll expand this advice in an upcoming patch 8.
Thanks, -Stolee