git-sparse-checkout.txt: shuffle some sections and mark as internal

With cone mode as the default, it makes sense to discuss it before non-cone mode. Also, the new default means we can just use directories in most cases and users do not need to understand patterns or their meanings. Let's take advantage of this to mark several sections as "INTERNALS", notifying the user that they do not need to know all those details in order to make use of the sparse-checkout command. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Apr 22, 2022 at 02:32 UTC 0d86f59a3c7ce06bebb44a691cf8743e8eda1fbe
1 file changed +24 -24
Documentation/git-sparse-checkout.txt
+24 -24
@@ -73,8 +73,8 @@ to be enabled.
73 When `--no-cone` is passed, the input list is considered a list of
74 patterns. This mode is harder to use and less performant, and is thus
75 not recommended. See the "Sparse Checkout" section of
76 -linkgit:git-read-tree[1] and the "Pattern Set" sections below for more
77 -details.
76 +linkgit:git-read-tree[1] and the "Internals...Pattern Set" sections
77 +below for more details.
78 +
79 Use the `--[no-]sparse-index` option to use a sparse index (the
80 default is to not use it). A sparse index reduces the size of the
@@ -136,8 +136,8 @@ paths to pass to a subsequent 'set' or 'add' command. However,
136 the disable command, so the easy restore of calling a plain `init`
137 decreased in utility.
138
139 -SPARSE CHECKOUT
140 ----------------
139 +INTERNALS -- SPARSE CHECKOUT
140 +----------------------------
141
142 "Sparse checkout" allows populating the working directory sparsely. It
143 uses the skip-worktree bit (see linkgit:git-update-index[1]) to tell Git
@@ -161,24 +161,8 @@ To repopulate the working directory with all files, use the
161 `git sparse-checkout disable` command.
162
163
164 -FULL PATTERN SET
165 -----------------
166 -
167 -By default, the sparse-checkout file uses the same syntax as `.gitignore`
168 -files.
169 -
170 -While `$GIT_DIR/info/sparse-checkout` is usually used to specify what
171 -files are included, you can also specify what files are _not_ included,
172 -using negative patterns. For example, to remove the file `unwanted`:
173 -
174 -----------------
175 -/*
176 -!unwanted
177 -----------------
178 -
179 -
180 -CONE PATTERN SET
181 -----------------
164 +INTERNALS -- CONE PATTERN SET
165 +-----------------------------
166
167 The full pattern set allows for arbitrary pattern matches and complicated
168 inclusion/exclusion rules. These can result in O(N*M) pattern matches when
@@ -256,8 +240,24 @@ use `git add` and `git commit` to store them, then remove any remaining files
240 manually to ensure Git can behave optimally.
241
242
259 -SUBMODULES
260 -----------
243 +INTERNALS -- FULL PATTERN SET
244 +-----------------------------
245 +
246 +By default, the sparse-checkout file uses the same syntax as `.gitignore`
247 +files.
248 +
249 +While `$GIT_DIR/info/sparse-checkout` is usually used to specify what
250 +files are included, you can also specify what files are _not_ included,
251 +using negative patterns. For example, to remove the file `unwanted`:
252 +
253 +----------------
254 +/*
255 +!unwanted
256 +----------------
257 +
258 +
259 +INTERNALS -- SUBMODULES
260 +-----------------------
261
262 If your repository contains one or more submodules, then submodules
263 are populated based on interactions with the `git submodule` command.