git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/5] submodule: expose the '--for-status' option of summary

From
Shourya Shukla <shouryashukla.oo@gmail.com>
Date
Aug 6, 2020, 16:40 UTC
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.<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@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 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
Previous: Shourya ShuklaNext: Kaartic Sivaraam
Message 9 of 32 in “submodule: port subcommand 'summary' from shell to C”
  1. Shourya ShuklaAug 6, 2020
  2. 5/5 submodule: port submodule subcommand 'summary' from shell to CShourya Shukla, Aug 6, 2020
  3. Junio C HamanoAug 6, 2020
  4. Shourya ShuklaAug 7, 2020
  5. Junio C HamanoAug 7, 2020
  6. 2/5 submodule: remove extra line feeds between callback struct and macroShourya Shukla, Aug 6, 2020
  7. 3/5 submodule: rename helper functions to avoid ambiguityShourya Shukla, Aug 6, 2020
  8. 4/5 t7421: introduce a test script for verifying 'summary' outputShourya Shukla, Aug 6, 2020
  9. 1/5 submodule: expose the '--for-status' option of summaryShourya Shukla, Aug 6, 2020
  10. Kaartic SivaraamAug 8, 2020
  11. Christian CouderAug 8, 2020
  12. Junio C HamanoAug 8, 2020
  13. [GSoC][PATCH v3 0/4] submodule: port subcommand 'summary' from shell to CShourya Shukla, Aug 12, 2020
  14. 1/4 submodule: remove extra line feeds between callback struct and macroShourya Shukla, Aug 12, 2020
  15. 2/4 submodule: rename helper functions to avoid ambiguityShourya Shukla, Aug 12, 2020
  16. 3/4 t7421: introduce a test script for verifying 'summary' outputShourya Shukla, Aug 12, 2020
  17. 4/4 submodule: port submodule subcommand 'summary' from shell to CShourya Shukla, Aug 12, 2020
  18. Jeff KingAug 18, 2020
  19. Shourya ShuklaAug 21, 2020
  20. Johannes SchindelinAug 21, 2020
  21. Junio C HamanoAug 21, 2020
  22. Shourya ShuklaAug 21, 2020
  23. Junio C HamanoAug 21, 2020
  24. Kaartic SivaraamAug 21, 2020
  25. Junio C HamanoAug 21, 2020
  26. Kaartic SivaraamAug 23, 2020
  27. Kaartic SivaraamAug 23, 2020
  28. Shourya ShuklaAug 24, 2020
  29. Shourya ShuklaAug 24, 2020
  30. Kaartic SivaraamAug 24, 2020
  31. Shourya ShuklaAug 24, 2020
  32. Junio C HamanoAug 24, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.