summaryrefslogtreecommitdiff
path: root/Documentation/git-sparse-checkout.txt
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-03-30 13:11:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-30 19:57:48 (GMT)
commit122ba1f7b52612e197db76aded1f9681b80f3085 (patch)
tree96c6481a4c55e07f93667a601b475a6e759c4195 /Documentation/git-sparse-checkout.txt
parent58300f4743231724686d9ddf481aeefa4f90d2f7 (diff)
downloadgit-122ba1f7b52612e197db76aded1f9681b80f3085.zip
git-122ba1f7b52612e197db76aded1f9681b80f3085.tar.gz
git-122ba1f7b52612e197db76aded1f9681b80f3085.tar.bz2
sparse-checkout: toggle sparse index from builtin
The sparse index extension is used to signal that index writes should be in sparse mode. This was only updated using GIT_TEST_SPARSE_INDEX=1. Add a '--[no-]sparse-index' option to 'git sparse-checkout init' that specifies if the sparse index should be used. It also updates the index to use the correct format, either way. Add a warning in the documentation that the use of a repository extension might reduce compatibility with third-party tools. 'git sparse-checkout init' already sets extension.worktreeConfig, which places most sparse-checkout users outside of the scope of most third-party tools. Update t1092-sparse-checkout-compatibility.sh to use this CLI instead of GIT_TEST_SPARSE_INDEX=1. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-sparse-checkout.txt')
-rw-r--r--Documentation/git-sparse-checkout.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index a0eeaeb..fdcf43f 100644
--- a/Documentation/git-sparse-checkout.txt
+++ b/Documentation/git-sparse-checkout.txt
@@ -45,6 +45,20 @@ To avoid interfering with other worktrees, it first enables the
When `--cone` is provided, the `core.sparseCheckoutCone` setting is
also set, allowing for better performance with a limited set of
patterns (see 'CONE PATTERN SET' below).
++
+Use the `--[no-]sparse-index` option to toggle the use of the sparse
+index format. This reduces the size of the index to be more closely
+aligned with your sparse-checkout definition. This can have significant
+performance advantages for commands such as `git status` or `git add`.
+This feature is still experimental. Some commands might be slower with
+a sparse index until they are properly integrated with the feature.
++
+**WARNING:** Using a sparse index requires modifying the index in a way
+that is not completely understood by external tools. If you have trouble
+with this compatibility, then run `git sparse-checkout init --no-sparse-index`
+to rewrite your index to not be sparse. Older versions of Git will not
+understand the sparse directory entries index extension and may fail to
+interact with your repository until it is disabled.
'set'::
Write a set of patterns to the sparse-checkout file, as given as