gitsubmodules doc: invoke 'ls-files' with '--recurse-submodules'
`git ls-files` was never taught to respect the `submodule.recurse` configuration variable, and it is too late now to change that [1], but still the command is mentioned in 'gitsubmodules(7)' as if it does respect that config. Adjust the call in 'gitsubmodules(7)' by calling 'ls-files' with the '--recurse-submodules' option. While at it, uniformize the capitalization in that file, and use backticks instead of quotes for Git commands and configuration variables. [1] https://lore.kernel.org/git/pull.732.git.1599707259907.gitgitgadget@gmail.com/T/#u Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philippe Blain committed
Oct 4, 2020 at 01:17 UTC
7d15fdbe4c468c953eef170de645538fd7ccb4b8
1 file changed
+13
-10
Documentation/gitsubmodules.txt
+13
-10
@@ -225,10 +225,10 @@ presence of the .url field.
225
Workflow for a third party library
226
----------------------------------
227
228
- # add a submodule
228
+ # Add a submodule
229
git submodule add <url> <path>
230
231
- # occasionally update the submodule to a new version:
231
+ # Occasionally update the submodule to a new version:
232
git -C <path> checkout <new version>
233
git add <path>
234
git commit -m "update submodule to new version"
@@ -246,20 +246,23 @@ Workflow for an artificially split repo
246
# regular commands recurse into submodules by default
247
git config --global submodule.recurse true
248
249
- # Unlike the other commands below clone still needs
249
+ # Unlike most other commands below, clone still needs
250
# its own recurse flag:
251
git clone --recurse <URL> <directory>
252
cd <directory>
253
254
# Get to know the code:
255
git grep foo
256
- git ls-files
256
+ git ls-files --recurse-submodules
257
+
258
+[NOTE]
259
+`git ls-files` also requires its own `--recurse-submodules` flag.
260
261
# Get new code
262
git fetch
263
git pull --rebase
264
262
- # change worktree
265
+ # Change worktree
266
git checkout
267
git reset
268
@@ -267,12 +270,12 @@ Implementation details
270
----------------------
271
272
When cloning or pulling a repository containing submodules the submodules
270
-will not be checked out by default; You can instruct 'clone' to recurse
271
-into submodules. The 'init' and 'update' subcommands of 'git submodule'
273
+will not be checked out by default; you can instruct `clone` to recurse
274
+into submodules. The `init` and `update` subcommands of `git submodule`
275
will maintain submodules checked out and at an appropriate revision in
273
-your working tree. Alternatively you can set 'submodule.recurse' to have
274
-'checkout' recursing into submodules (note that 'submodule.recurse' also
275
-affects other git commands, see linkgit:git-config[1] for a complete list).
276
+your working tree. Alternatively you can set `submodule.recurse` to have
277
+`checkout` recursing into submodules (note that `submodule.recurse` also
278
+affects other Git commands, see linkgit:git-config[1] for a complete list).
279
280
281
SEE ALSO