sparse-checkout: toggle sparse index from builtin
commit122ba1f7b52612e197db76aded1f9681b80f3085
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 30 Mar 2021 13:11:00 +0000 (30 13:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Mar 2021 19:57:48 +0000 (30 12:57 -0700)
tree96c6481a4c55e07f93667a601b475a6e759c4195
parent58300f4743231724686d9ddf481aeefa4f90d2f7
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>
Documentation/git-sparse-checkout.txt
builtin/sparse-checkout.c
sparse-index.c
sparse-index.h
t/t1092-sparse-checkout-compatibility.sh