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>
This commit is contained in:

committed by
Junio C Hamano

parent
4bf0c06c71
commit
2631dc879d
@ -59,6 +59,13 @@ directories. The input format matches the output of `git ls-tree --name-only`.
|
||||
This includes interpreting pathnames that begin with a double quote (") as
|
||||
C-style quoted strings.
|
||||
|
||||
'add'::
|
||||
Update the sparse-checkout file to include additional patterns.
|
||||
By default, these patterns are read from the command-line arguments,
|
||||
but they can be read from stdin using the `--stdin` option. When
|
||||
`core.sparseCheckoutCone` is enabled, the given patterns are interpreted
|
||||
as directory names as in the 'set' subcommand.
|
||||
|
||||
'disable'::
|
||||
Disable the `core.sparseCheckout` config setting, and restore the
|
||||
working directory to include all files. Leaves the sparse-checkout
|
||||
|
Reference in New Issue
Block a user