File tree Expand file tree Collapse file tree 7 files changed +55
-11
lines changed Expand file tree Collapse file tree 7 files changed +55
-11
lines changed Original file line number Diff line number Diff line change @@ -2214,7 +2214,14 @@ status.submodulesummary::
2214
2214
If this is set to a non zero number or true (identical to -1 or an
2215
2215
unlimited number), the submodule summary will be enabled and a
2216
2216
summary of commits for modified submodules will be shown (see
2217
- --summary-limit option of linkgit:git-submodule[1]).
2217
+ --summary-limit option of linkgit:git-submodule[1]). Please note
2218
+ that the summary output command will be suppressed for all
2219
+ submodules when `diff.ignoreSubmodules` is set to 'all' or only
2220
+ for those submodules where `submodule.<name>.ignore=all`. To
2221
+ also view the summary for ignored submodules you can either use
2222
+ the --ignore-submodules=dirty command line option or the 'git
2223
+ submodule summary' command, which shows a similar output but does
2224
+ not honor these settings.
2218
2225
2219
2226
submodule.<name>.path::
2220
2227
submodule.<name>.url::
@@ -2249,7 +2256,8 @@ submodule.<name>.ignore::
2249
2256
submodules that have untracked files in their work tree as changed.
2250
2257
This setting overrides any setting made in .gitmodules for this submodule,
2251
2258
both settings can be overridden on the command line by using the
2252
- "--ignore-submodules" option.
2259
+ "--ignore-submodules" option. The 'git submodule' commands are not
2260
+ affected by this setting.
2253
2261
2254
2262
tar.umask::
2255
2263
This variable can be used to restrict the permission bits of
Original file line number Diff line number Diff line change @@ -73,7 +73,11 @@ diff.ignoreSubmodules::
73
73
Sets the default value of --ignore-submodules. Note that this
74
74
affects only 'git diff' Porcelain, and not lower level 'diff'
75
75
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.
77
81
78
82
diff.mnemonicprefix::
79
83
If set, 'git diff' uses a prefix pair that is different from the
Original file line number Diff line number Diff line change @@ -210,7 +210,13 @@ directory.
210
210
If `status.submodulesummary` is set to a non zero number or true (identical
211
211
to -1 or an unlimited number), the submodule summary will be enabled for
212
212
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.
214
220
215
221
SEE ALSO
216
222
--------
Original file line number Diff line number Diff line change @@ -75,7 +75,8 @@ submodule.<name>.ignore::
75
75
the superproject, the setting there will override the one found in
76
76
.gitmodules.
77
77
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.
79
80
80
81
81
82
EXAMPLES
Original file line number Diff line number Diff line change @@ -1032,13 +1032,20 @@ cmd_summary() {
1032
1032
# Get modified modules cared by user
1033
1033
modules=$( git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- " $@ " |
1034
1034
sane_egrep ' ^:([0-7]* )?160000' |
1035
- while read mod_src mod_dst sha1_src sha1_dst status name
1035
+ while read mod_src mod_dst sha1_src sha1_dst status sm_path
1036
1036
do
1037
1037
# Always show modules deleted or type-changed (blob<->module)
1038
- test $status = D -o $status = T && echo " $name " && continue
1038
+ test $status = D -o $status = T && echo " $sm_path " && continue
1039
+ # Respect the ignore setting for --for-status.
1040
+ if test -n " $for_status "
1041
+ then
1042
+ name=$( module_name " $sm_path " )
1043
+ ignore_config=$( get_submodule_config " $name " ignore none)
1044
+ test $status ! = A -a $ignore_config = all && continue
1045
+ fi
1039
1046
# Also show added or modified modules which are checked out
1040
- GIT_DIR=" $name /.git" git-rev-parse --git-dir > /dev/null 2>&1 &&
1041
- echo " $name "
1047
+ GIT_DIR=" $sm_path /.git" git-rev-parse --git-dir > /dev/null 2>&1 &&
1048
+ echo " $sm_path "
1042
1049
done
1043
1050
)
1044
1051
Original file line number Diff line number Diff line change 104
104
test_cmp expected actual
105
105
"
106
106
107
+ test_expect_success ' no ignore=all setting has any effect' "
108
+ git config -f .gitmodules submodule.sm1.path sm1 &&
109
+ git config -f .gitmodules submodule.sm1.ignore all &&
110
+ git config submodule.sm1.ignore all &&
111
+ git config diff.ignoreSubmodules all &&
112
+ git submodule summary >actual &&
113
+ cat >expected <<-EOF &&
114
+ * sm1 $head1 ...$head2 (1):
115
+ > Add foo3
116
+
117
+ EOF
118
+ test_cmp expected actual &&
119
+ git config --unset diff.ignoreSubmodules &&
120
+ git config --remove-section submodule.sm1 &&
121
+ git config -f .gitmodules --remove-section submodule.sm1
122
+ "
123
+
124
+
107
125
commit_file sm1 &&
108
126
head3=$(
109
127
cd sm1 &&
Original file line number Diff line number Diff line change @@ -1380,15 +1380,15 @@ EOF
1380
1380
test_i18ncmp expect output
1381
1381
'
1382
1382
1383
- test_expect_failure ' .gitmodules ignore=all suppresses submodule summary' '
1383
+ test_expect_success ' .gitmodules ignore=all suppresses submodule summary' '
1384
1384
git config --add -f .gitmodules submodule.subname.ignore all &&
1385
1385
git config --add -f .gitmodules submodule.subname.path sm &&
1386
1386
git status > output &&
1387
1387
test_cmp expect output &&
1388
1388
git config -f .gitmodules --remove-section submodule.subname
1389
1389
'
1390
1390
1391
- test_expect_failure ' .git/config ignore=all suppresses submodule summary' '
1391
+ test_expect_success ' .git/config ignore=all suppresses submodule summary' '
1392
1392
git config --add -f .gitmodules submodule.subname.ignore none &&
1393
1393
git config --add -f .gitmodules submodule.subname.path sm &&
1394
1394
git config --add submodule.subname.ignore all &&
You can’t perform that action at this time.
0 commit comments