sparse-checkout: improve docs around 'set' in cone mode
The existing documentation does not clarify how the 'set' subcommand changes when core.sparseCheckoutCone is enabled. Correct this by changing some language around the "A/B/C" example. Also include a description of the input format matching the output of 'git ls-tree --name-only'. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Derrick Stolee committed
Jan 31, 2020 at 20:16 UTC
d2e65f4c9056be72ff8a1f39245c5e1b27d556b2
1 file changed
+14
-3
Documentation/git-sparse-checkout.txt
+14
-3
@@ -50,6 +50,14 @@ To avoid interfering with other worktrees, it first enables the
50
+
51
When the `--stdin` option is provided, the patterns are read from
52
standard in as a newline-delimited list instead of from the arguments.
53
++
54
+When `core.sparseCheckoutCone` is enabled, the input list is considered a
55
+list of directories instead of sparse-checkout patterns. The command writes
56
+patterns to the sparse-checkout file to include all files contained in those
57
+directories (recursively) as well as files that are siblings of ancestor
58
+directories. The input format matches the output of `git ls-tree --name-only`.
59
+This includes interpreting pathnames that begin with a double quote (") as
60
+C-style quoted strings.
61
62
'disable'::
63
Disable the `core.sparseCheckout` config setting, and restore the
@@ -128,9 +136,12 @@ the following patterns:
136
----------------
137
138
This says "include everything in root, but nothing two levels below root."
131
-If we then add the folder `A/B/C` as a recursive pattern, the folders `A` and
132
-`A/B` are added as parent patterns. The resulting sparse-checkout file is
133
-now
139
+
140
+When in cone mode, the `git sparse-checkout set` subcommand takes a list of
141
+directories instead of a list of sparse-checkout patterns. In this mode,
142
+the command `git sparse-checkout set A/B/C` sets the directory `A/B/C` as
143
+a recursive pattern, the directories `A` and `A/B` are added as parent
144
+patterns. The resulting sparse-checkout file is now
145
146
----------------
147
/*