git-sparse-checkout.txt: wording updates for the cone mode default

Now that cone mode is the default, we'd like to focus on the arguments
to set/add being directories rather than patterns, and it probably makes
sense to provide an earlier heads up that files from leading directories
get included as well.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren 2022-04-22 02:32:20 +00:00 committed by Junio C Hamano
parent 2d95707a02
commit f69dfef355

View File

@ -44,9 +44,9 @@ COMMANDS
Enable the necessary sparse-checkout config settings Enable the necessary sparse-checkout config settings
(`core.sparseCheckout`, `core.sparseCheckoutCone`, and (`core.sparseCheckout`, `core.sparseCheckoutCone`, and
`index.sparse`) if they are not already set to the desired values, `index.sparse`) if they are not already set to the desired values,
and write a set of patterns to the sparse-checkout file from the populate the sparse-checkout file from the list of arguments
list of arguments following the 'set' subcommand. Update the following the 'set' subcommand, and update the working directory to
working directory to match the new patterns. match.
+ +
To ensure that adjusting the sparse-checkout settings within a worktree To ensure that adjusting the sparse-checkout settings within a worktree
does not alter the sparse-checkout settings in other worktrees, the 'set' does not alter the sparse-checkout settings in other worktrees, the 'set'
@ -60,15 +60,15 @@ When the `--stdin` option is provided, the directories or patterns are
read from standard in as a newline-delimited list instead of from the read from standard in as a newline-delimited list instead of from the
arguments. arguments.
+ +
When `--cone` is passed or `core.sparseCheckoutCone` is not false, the By default, the input list is considered a list of directories, matching
input list is considered a list of directories. This allows for the output of `git ls-tree -d --name-only`. This includes interpreting
better performance with a limited set of patterns (see 'CONE PATTERN pathnames that begin with a double quote (") as C-style quoted strings.
SET' below). The input format matches the output of `git ls-tree Note that all files under the specified directories (at any depth) will
--name-only`. This includes interpreting pathnames that begin with a be included in the sparse checkout, as well as files that are siblings
double quote (") as C-style quoted strings. Note that the set command of either the given directory or any of its ancestors (see 'CONE PATTERN
will write patterns to the sparse-checkout file to include all files SET' below for more details). In the past, this was not the default,
contained in those directories (recursively) as well as files that are and `--cone` needed to be specified or `core.sparseCheckoutCone` needed
siblings of ancestor directories. to be enabled.
+ +
When `--no-cone` is passed or `core.sparseCheckoutCone` is set to false, When `--no-cone` is passed or `core.sparseCheckoutCone` is set to false,
the input list is considered a list of patterns. This mode is harder the input list is considered a list of patterns. This mode is harder
@ -208,10 +208,9 @@ the following patterns:
This says "include everything in root, but nothing two levels below root." This says "include everything in root, but nothing two levels below root."
When in cone mode, the `git sparse-checkout set` subcommand takes a list of When in cone mode, the `git sparse-checkout set` subcommand takes a list of
directories instead of a list of sparse-checkout patterns. In this mode, directories. In this mode, the command `git sparse-checkout set A/B/C` sets
the command `git sparse-checkout set A/B/C` sets the directory `A/B/C` as the directory `A/B/C` as a recursive pattern, the directories `A` and `A/B`
a recursive pattern, the directories `A` and `A/B` are added as parent are added as parent patterns. The resulting sparse-checkout file is now
patterns. The resulting sparse-checkout file is now
---------------- ----------------
/* /*