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

[RFC PATCH 0/2] Teach "git status" the "--ignore-submodules" option

From
Jens Lehmann <jens.lehmann@web.de>
Date
Jun 25, 2010, 14:55 UTC
Message-ID
<4C24C34B.20403@web.de>

The first patch in this series lets "git submodule summary" and "git submodule status" ignore dirty submodules. I thought about teaching them a "--ignore" option too, but didn't for two reasons: First, the output of those commands is pretty much focused on commits. Second, when using "git status" with the config option 'status.submodulesummary' the submodule tree is scanned twice, once for "git status" and then again for "git submodule summary". With this patch the second run is gone, which is a big gain for users of 'status.submodulesummary' with large submodules.

The second patch teaches "git status" the same "--ignore-submodules" option that "git diff" recently learned. Ignoring all changes also suppresses the output of "git submodule summary" when 'status.submodulesummary' is set.

After this series I am planning to add a config option 'ignore' to .gitmodules, which can be set for each submodule to either "all", "dirty", "untracked" or "none" (the default). "git diff" and "git status" will use that config value for each submodule. Using "--ignore-submodule" overrides this default (and the new parameter "none" will be added there to able to override the config settings). And to avoid having to do "git submdule sync" every time that option changes, I would like to search for it in .git/config first. If it is not found there, it will be taken from .gitmodules, if present. So users can override the setting but if they don't, upstream can change it easily (e.g. when a submodules .gitignore has been updated so that "ignore=untracked" is no longer necessary anymore it can be removed). Also switching branches will have an effect instantly if the 'ignore' entry in .gitmodules is different between branches.

Opinions?
Jens Lehmann (2):
  git submodule: ignore dirty submodules for summary and status
  Add the option "--ignore-submodules" to "git status"
 Documentation/git-status.txt |   11 ++++
 builtin/commit.c             |    7 ++-
 diff.c                       |   15 +----
 git-submodule.sh             |    6 +-
 submodule.c                  |   13 ++++
 submodule.h                  |    3 +
 t/t7508-status.sh            |  127 ++++++++++++++++++++++++++++++++++++++++++
 wt-status.c                  |   10 +++-
 wt-status.h                  |    1 +
 9 files changed, 177 insertions(+), 16 deletions(-)
-- 
1.7.1.757.g0ad3c.dirty
Next: Jens Lehmann
Message 1 of 12 in “Teach "git status" the "--ignore-submodules" option”
  1. 0/2 Teach "git status" the "--ignore-submodules" optionJens Lehmann, Jun 25, 2010
  2. 1/2 git submodule: ignore dirty submodules for summary and statusJens Lehmann, Jun 25, 2010
  3. 2/2 Add the option "--ignore-submodules" to "git status"Jens Lehmann, Jun 25, 2010
  4. Junio C HamanoJun 25, 2010
  5. git-gui and gitk-git as submodules (Re: [RFC PATCH 0/2] Teach "git status" the "--ignore-submodules" option)Jonathan Nieder, Jun 25, 2010
  6. Tay Ray ChuanJun 26, 2010
  7. Jens LehmannJun 26, 2010
  8. Jonathan NiederJun 26, 2010
  9. Jens LehmannJun 28, 2010
  10. Marc BranchaudJun 28, 2010
  11. Jens LehmannJun 28, 2010
  12. Marc BranchaudJun 28, 2010

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.