Skip to content

Commit 3147aa4

Browse files
periperidipgitster
authored andcommitted
submodule: expose the '--for-status' option of summary
The 'for-status' option is used to compute the summary of submodule(s) in a superproject by skipping the ignored submdules i.e., those with 'submodule.<name>.ignore' set to 'all' in the '.gitmodules' or '.git/config', with the latter taking precedence over the former. The option was introduced in d0f64dd (git-submodule summary: --for-status option, 2008-04-12), refined in 3ba7407 (submodule summary: ignore --for-status option, 2013-09-06) and finally perfected in 927b26f (submodule: don't print status output with ignore=all, 2013-09-01). But, it was not mentioned in the 'git submodule' Documentation. Expose the '--for-status' option accepted by the command 'git submodule summary'. Mentored-by: Christian Couder <[email protected]> Mentored-by: Kaartic Sivaraam <[email protected]> Signed-off-by: Shourya Shukla <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dc04167 commit 3147aa4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Documentation/git-submodule.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ set-url [--] <path> <newurl>::
190190
automatically synchronize the submodule's new remote URL
191191
configuration.
192192

193-
summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--] [<path>...]::
193+
summary [--cached|--files] [--for-status] [(-n|--summary-limit) <n>] [commit] [--] [<path>...]::
194194
Show commit summary between the given commit (defaults to HEAD) and
195195
working tree/index. For a submodule in question, a series of commits
196196
in the submodule between the given super project commit and the
@@ -309,6 +309,12 @@ OPTIONS
309309
compares the commit in the index with that in the submodule HEAD
310310
when this option is used.
311311

312+
--for-status::
313+
This option is only valid for the summary command. This command
314+
skips the submodules with `submodule.<name>.ignore` set to `all`
315+
in the `.gitmodules` or `.git/config`. The configuration in
316+
`.git/config` overrides the configuration in `.gitmodules`.
317+
312318
-n::
313319
--summary-limit::
314320
This option is only valid for the summary command.

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3059,7 +3059,7 @@ _git_submodule ()
30593059
__gitcomp "--default --branch"
30603060
;;
30613061
summary,--*)
3062-
__gitcomp "--cached --files --summary-limit"
3062+
__gitcomp "--cached --files --for-status --summary-limit"
30633063
;;
30643064
foreach,--*|sync,--*)
30653065
__gitcomp "--recursive"

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ USAGE="[--quiet] [--cached]
1313
or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] [--] [<path>...]
1414
or: $dashless [--quiet] set-branch (--default|--branch <branch>) [--] <path>
1515
or: $dashless [--quiet] set-url [--] <path> <newurl>
16-
or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
16+
or: $dashless [--quiet] summary [--cached|--files] [--for-status] [--summary-limit <n>] [commit] [--] [<path>...]
1717
or: $dashless [--quiet] foreach [--recursive] <command>
1818
or: $dashless [--quiet] sync [--recursive] [--] [<path>...]
1919
or: $dashless [--quiet] absorbgitdirs [--] [<path>...]"

0 commit comments

Comments
 (0)