As you mention, the patch git submodule: ignore dirty submodules for summary and status is in the making.
Also announced in the Git 1.7.2-rc2 release:
Git v1.7.2 Release Notes (draft)
================================
Updates since v1.7.1
--------------------
"git status
" learned "--ignore-submodules
" option.
Meaning:
git config --global diff.ignoreSubmodules dirty
Regarding this as an option is not exactly the approach chosen for now:
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.
Another approach to make git status (or any git command) to ignore a particular submodule is available with Git 2.13 (Q2 2017):
git config submodule.<name>.active false
See more at "Ignore new commits for git submodule".
ignore=dirty
to individual entries in.gitmodules
file here. – Anesthesiologist