Skip to content

Commit bb58b69

Browse files
jlehmanngitster
authored andcommitted
Improve documentation concerning the status.submodulesummary setting
'git status' and 'git commit' can be told to also show the output of "git submodule summary" by setting the "status.submodulesummary" config option. But status and commit also honor the "diff.ignoreSubmodules" and the "submodule.<name>.ignore" settings, which then disable the summary partly or completely. This - and the fact that the last two settings do not affect the "git submodule" commands at all - is not well documented. Extend the documentation in those places where "status.submodulesummary", "diff.ignoreSubmodules" and "submodule.<name>.ignore" are described to better explain these dependencies. Thanks-to: Matthieu Moy <[email protected]> Signed-off-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 927b26f commit bb58b69

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

Documentation/config.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,14 @@ status.submodulesummary::
21422142
If this is set to a non zero number or true (identical to -1 or an
21432143
unlimited number), the submodule summary will be enabled and a
21442144
summary of commits for modified submodules will be shown (see
2145-
--summary-limit option of linkgit:git-submodule[1]).
2145+
--summary-limit option of linkgit:git-submodule[1]). Please note
2146+
that the summary output command will be suppressed for all
2147+
submodules when `diff.ignoreSubmodules` is set to 'all' or only
2148+
for those submodules where `submodule.<name>.ignore=all`. To
2149+
also view the summary for ignored submodules you can either use
2150+
the --ignore-submodules=dirty command line option or the 'git
2151+
submodule summary' command, which shows a similar output but does
2152+
not honor these settings.
21462153

21472154
submodule.<name>.path::
21482155
submodule.<name>.url::
@@ -2177,7 +2184,8 @@ submodule.<name>.ignore::
21772184
submodules that have untracked files in their work tree as changed.
21782185
This setting overrides any setting made in .gitmodules for this submodule,
21792186
both settings can be overridden on the command line by using the
2180-
"--ignore-submodules" option.
2187+
"--ignore-submodules" option. The 'git submodule' commands are not
2188+
affected by this setting.
21812189

21822190
tar.umask::
21832191
This variable can be used to restrict the permission bits of

Documentation/diff-config.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ diff.ignoreSubmodules::
7373
Sets the default value of --ignore-submodules. Note that this
7474
affects only 'git diff' Porcelain, and not lower level 'diff'
7575
commands such as 'git diff-files'. 'git checkout' also honors
76-
this setting when reporting uncommitted changes.
76+
this setting when reporting uncommitted changes. Setting it to
77+
'all' disables the submodule summary normally shown by 'git commit'
78+
and 'git status' when 'status.submodulesummary' is set unless it is
79+
overridden by using the --ignore-submodules command line option.
80+
The 'git submodule' commands are not affected by this setting.
7781

7882
diff.mnemonicprefix::
7983
If set, 'git diff' uses a prefix pair that is different from the

Documentation/git-status.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,13 @@ directory.
210210
If `status.submodulesummary` is set to a non zero number or true (identical
211211
to -1 or an unlimited number), the submodule summary will be enabled for
212212
the long format and a summary of commits for modified submodules will be
213-
shown (see --summary-limit option of linkgit:git-submodule[1]).
213+
shown (see --summary-limit option of linkgit:git-submodule[1]). Please note
214+
that the summary output from the status command will be suppressed for all
215+
submodules when `diff.ignoreSubmodules` is set to 'all' or only for those
216+
submodules where `submodule.<name>.ignore=all`. To also view the summary for
217+
ignored submodules you can either use the --ignore-submodules=dirty command
218+
line option or the 'git submodule summary' command, which shows a similar
219+
output but does not honor these settings.
214220

215221
SEE ALSO
216222
--------

Documentation/gitmodules.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ submodule.<name>.ignore::
7575
the superproject, the setting there will override the one found in
7676
.gitmodules.
7777
Both settings can be overridden on the command line by using the
78-
"--ignore-submodule" option.
78+
"--ignore-submodule" option. The 'git submodule' commands are not
79+
affected by this setting.
7980

8081

8182
EXAMPLES

0 commit comments

Comments
 (0)