From: Shourya Shukla Date: Thu, 06 Aug 2020 16:40:58 GMT Subject: [PATCH v2 1/5] submodule: expose the '--for-status' option of summary Message-ID: <20200806164102.6707-2-shouryashukla.oo@gmail.com> In-Reply-To: <20200806164102.6707-1-shouryashukla.oo@gmail.com> 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..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 Mentored-by: Kaartic Sivaraam Signed-off-by: Shourya Shukla --- 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 [--] :: automatically synchronize the submodule's new remote URL configuration. -summary [--cached|--files] [(-n|--summary-limit) ] [commit] [--] [...]:: +summary [--cached|--files] [--for-status] [(-n|--summary-limit) ] [commit] [--] [...]:: 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..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 ] [--recursive] [--[no-]single-branch] [--] [...] or: $dashless [--quiet] set-branch (--default|--branch ) [--] or: $dashless [--quiet] set-url [--] - or: $dashless [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...] + or: $dashless [--quiet] summary [--cached|--files] [--for-status] [--summary-limit ] [commit] [--] [...] or: $dashless [--quiet] foreach [--recursive] or: $dashless [--quiet] sync [--recursive] [--] [...] or: $dashless [--quiet] absorbgitdirs [--] [...]" -- 2.28.0