[PATCH v2 6/8] sparse-index: point users to new 'clean' action
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jul 17, 2025, 01:34 UTC
- Message-ID
- <d6dbc0b5ca9cdcd5956e02a0fe603b170dbae1ce.1752716054.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1941.v2.git.1752716054.gitgitgadget@gmail.com>
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 ff33b8516b9f..cbf2bf618c37 100644 --- a/sparse-index.c +++ b/sparse-index.c @@ -31,7 +31,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." struct modify_index_context { struct index_state *write;
-- gitgitgadget