sparse-checkout: create 'add' subcommand
commit2631dc879d59aa08095bc4fb5bc9bcc491a787e9
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 11 Feb 2020 15:02:23 +0000 (11 15:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Feb 2020 17:06:46 +0000 (11 09:06 -0800)
treec0afb9dc10413683f520aff4396c2e7d554d6b04
parent4bf0c06c7169da61de489544207a7659ef31029f
sparse-checkout: create 'add' subcommand

When using the sparse-checkout feature, a user may want to incrementally
grow their sparse-checkout pattern set. Allow adding patterns using a
new 'add' subcommand. This is not much different from the 'set'
subcommand, because we still want to allow the '--stdin' option and
interpret inputs as directories when in cone mode and patterns
otherwise.

When in cone mode, we are growing the cone. This may actually reduce the
set of patterns when adding directory A when A/B is already a directory
in the cone. Test the different cases: siblings, parents, ancestors.

When not in cone mode, we can only assume the patterns should be
appended to the sparse-checkout file.

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
t/t1091-sparse-checkout-builtin.sh