Skip to content

Commit cc908db

Browse files
committed
Merge branch 'dr/doc-recurse-submodules'
Documentation updates around the "--recurse-submodules" option. * dr/doc-recurse-submodules: doc: --recurse-submodules mostly applies to active submodules doc: be more precise on (fetch|push).recurseSubmodules doc: explain how to deactivate submodule.recurse completely doc: document --recurse-submodules for reset and restore doc: list all commands affected by submodule.recurse
2 parents 9404128 + acbfae3 commit cc908db

File tree

13 files changed

+52
-19
lines changed

13 files changed

+52
-19
lines changed

Documentation/config/fetch.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
fetch.recurseSubmodules::
2-
This option can be either set to a boolean value or to 'on-demand'.
2+
This option controls whether `git fetch` (and the underlying fetch
3+
in `git pull`) will recursively fetch into populated submodules.
4+
This option can be set either to a boolean value or to 'on-demand'.
35
Setting it to a boolean changes the behavior of fetch and pull to
4-
unconditionally recurse into submodules when set to true or to not
5-
recurse at all when set to false. When set to 'on-demand' (the default
6-
value), fetch and pull will only recurse into a populated submodule
7-
when its superproject retrieves a commit that updates the submodule's
6+
recurse unconditionally into submodules when set to true or to not
7+
recurse at all when set to false. When set to 'on-demand', fetch and
8+
pull will only recurse into a populated submodule when its
9+
superproject retrieves a commit that updates the submodule's
810
reference.
11+
Defaults to 'on-demand', or to the value of 'submodule.recurse' if set.
912

1013
fetch.fsckObjects::
1114
If it is set to true, git-fetch-pack will check all fetched

Documentation/config/push.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,5 @@ push.recurseSubmodules::
112112
is 'no' then default behavior of ignoring submodules when pushing
113113
is retained. You may override this configuration at time of push by
114114
specifying '--recurse-submodules=check|on-demand|no'.
115+
If not set, 'no' is used by default, unless 'submodule.recurse' is
116+
set (in which case a 'true' value means 'on-demand').

Documentation/config/submodule.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,17 @@ submodule.active::
5959

6060
submodule.recurse::
6161
Specifies if commands recurse into submodules by default. This
62-
applies to all commands that have a `--recurse-submodules` option,
63-
except `clone`.
62+
applies to all commands that have a `--recurse-submodules` option
63+
(`checkout`, `fetch`, `grep`, `pull`, `push`, `read-tree`, `reset`,
64+
`restore` and `switch`) except `clone` and `ls-files`.
6465
Defaults to false.
66+
When set to true, it can be deactivated via the
67+
`--no-recurse-submodules` option. Note that some Git commands
68+
lacking this option may call some of the above commands affected by
69+
`submodule.recurse`; for instance `git remote update` will call
70+
`git fetch` but does not have a `--no-recurse-submodules` option.
71+
For these commands a workaround is to temporarily change the
72+
configuration value by using `git -c submodule.recurse=0`.
6573

6674
submodule.fetchJobs::
6775
Specifies how many submodules are fetched/cloned at the same time.

Documentation/fetch-options.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ ifndef::git-pull[]
163163
value. Use 'on-demand' to only recurse into a populated submodule
164164
when the superproject retrieves a commit that updates the submodule's
165165
reference to a commit that isn't already in the local submodule
166-
clone.
166+
clone. By default, 'on-demand' is used, unless
167+
`fetch.recurseSubmodules` is set (see linkgit:git-config[1]).
167168
endif::git-pull[]
168169

169170
-j::

Documentation/git-checkout.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ Note that this option uses the no overlay mode by default (see also
292292

293293
--recurse-submodules::
294294
--no-recurse-submodules::
295-
Using `--recurse-submodules` will update the content of all initialized
295+
Using `--recurse-submodules` will update the content of all active
296296
submodules according to the commit recorded in the superproject. If
297297
local modifications in a submodule would be overwritten the checkout
298298
will fail unless `-f` is used. If nothing (or `--no-recurse-submodules`)
299-
is used, the work trees of submodules will not be updated.
299+
is used, submodules working trees will not be updated.
300300
Just like linkgit:git-submodule[1], this will detach `HEAD` of the
301301
submodule.
302302

Documentation/git-grep.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ OPTIONS
9393
with `--no-index`.
9494

9595
--recurse-submodules::
96-
Recursively search in each submodule that has been initialized and
96+
Recursively search in each submodule that is active and
9797
checked out in the repository. When used in combination with the
9898
<tree> option the prefix of all submodule output will be the name of
9999
the parent project's <tree> object. This option has no effect

Documentation/git-ls-files.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ a space) at the start of each line:
148148
top directory.
149149

150150
--recurse-submodules::
151-
Recursively calls ls-files on each submodule in the repository.
151+
Recursively calls ls-files on each active submodule in the repository.
152152
Currently there is only support for the --cached mode.
153153

154154
--abbrev[=<n>]::

Documentation/git-pull.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ OPTIONS
8585
Pass --verbose to git-fetch and git-merge.
8686

8787
--[no-]recurse-submodules[=yes|on-demand|no]::
88-
This option controls if new commits of all populated submodules should
89-
be fetched and updated, too (see linkgit:git-config[1] and
88+
This option controls if new commits of populated submodules should
89+
be fetched, and if the working trees of active submodules should be
90+
updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and
9091
linkgit:gitmodules[5]).
9192
+
9293
If the checkout is done via rebase, local submodule commits are rebased as well.

Documentation/git-read-tree.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ OPTIONS
116116
located in.
117117

118118
--[no-]recurse-submodules::
119-
Using --recurse-submodules will update the content of all initialized
119+
Using --recurse-submodules will update the content of all active
120120
submodules according to the commit recorded in the superproject by
121-
calling read-tree recursively, also setting the submodules HEAD to be
121+
calling read-tree recursively, also setting the submodules' HEAD to be
122122
detached at that commit.
123123

124124
--no-sparse-checkout::

Documentation/git-reset.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ but carries forward unmerged index entries.
8787
different between `<commit>` and `HEAD`.
8888
If a file that is different between `<commit>` and `HEAD` has local
8989
changes, reset is aborted.
90+
91+
--[no-]recurse-submodules::
92+
When the working tree is updated, using --recurse-submodules will
93+
also recursively reset the working tree of all active submodules
94+
according to the commit recorded in the superproject, also setting
95+
the submodules' HEAD to be detached at that commit.
9096
--
9197

9298
See "Reset, restore and revert" in linkgit:git[1] for the differences

0 commit comments

Comments
 (0)