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 d0f64dd44d (git-submodule summary: --for-status option, 2008-04-12), refined in 3ba7407b8b (submodule summary: ignore --for-status option, 2013-09-06) and finally perfected in 927b26f87a (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 <chriscool@xxxxxxxxxxxxx> Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@xxxxxxxxx> Signed-off-by: Shourya Shukla <shouryashukla.oo@xxxxxxxxx> --- Documentation/git-submodule.txt | 8 +++++++- contrib/completion/git-completion.bash | 2 +- git-submodule.sh | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 7e5f995f77..d944e4c817 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -190,7 +190,7 @@ set-url [--] <path> <newurl>:: automatically synchronize the submodule's new remote URL configuration. -summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--] [<path>...]:: +summary [--cached|--files] [--for-status] [(-n|--summary-limit) <n>] [commit] [--] [<path>...]:: Show commit summary between the given commit (defaults to HEAD) and working tree/index. For a submodule in question, a series of commits in the submodule between the given super project commit and the @@ -309,6 +309,12 @@ OPTIONS compares the commit in the index with that in the submodule HEAD when this option is used. +--for-status:: + This option is only valid for the summary command. This command + skips the submodules with `submodule.<name>.ignore` set to `all` + in the `.gitmodules` or `.git/config`. The configuration in + `.git/config` overrides the configuration in `.gitmodules`. + -n:: --summary-limit:: This option is only valid for the summary command. diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 0fdb5da83b..2b7b033c17 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3059,7 +3059,7 @@ _git_submodule () __gitcomp "--default --branch" ;; summary,--*) - __gitcomp "--cached --files --summary-limit" + __gitcomp "--cached --files --for-status --summary-limit" ;; foreach,--*|sync,--*) __gitcomp "--recursive" diff --git a/git-submodule.sh b/git-submodule.sh index 43eb6051d2..dda3fee167 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -13,7 +13,7 @@ USAGE="[--quiet] [--cached] or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] [--] [<path>...] or: $dashless [--quiet] set-branch (--default|--branch <branch>) [--] <path> or: $dashless [--quiet] set-url [--] <path> <newurl> - or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...] + or: $dashless [--quiet] summary [--cached|--files] [--for-status] [--summary-limit <n>] [commit] [--] [<path>...] or: $dashless [--quiet] foreach [--recursive] <command> or: $dashless [--quiet] sync [--recursive] [--] [<path>...] or: $dashless [--quiet] absorbgitdirs [--] [<path>...]" -- 2.28.0