2014: Note that even if there were such a config, git 2.0.1 (June 25th, 2014) would still show you a submodule which has been staged.
See commit 1d2f393 by Jens Lehmann (jlehmann)
Currently setting submodule.<name>.ignore and/or diff.ignoreSubmodules to "all" suppresses all output of submodule changes for the diff family, status and commit.
For status and commit this is really confusing, as it even when the user chooses to record a new commit for an ignored submodule by adding it manually this change won't show up under the to-be-committed changes.
To add insult to injury, a later "git commit" will error out with "nothing to commit" when only ignored submodules are staged.
Fix that by making wt_status always print staged submodule changes, no matter what ignore settings are configured.
The only exception is when the user explicitly uses the "--ignore-submodules=all" command line option, in that case the submodule output is still suppressed.
This also makes "git commit" work again when only modifications of ignored submodules are staged, as that command uses the "commitable" member of the wt_status struct to determine if staged changes are present.
See also commit c215d3d for the git commit part.
To add insult to injury, a later "git commit" will error out with "nothing to commit" when only ignored submodules are staged.
Actually... with Git 2.42 (Q3 2023), even when diff.ignoreSubmodules tells us to ignore submodule changes, "git commit"(man) with an index that already records changes to submodules should include the submodule changes in the resulting commit, but it did not.
And this has been fixed!
See commit 5768478 (14 Jun 2023) by Josip Sokcevic (sokac).
(Merged by Junio C Hamano -- gitster -- in commit 4ee088d, 23 Jun 2023)
diff-lib: honor override_submodule_config flag bit
Signed-off-by: Josip Sokcevic
When diff.ignoreSubmodules = all is set and submodule commits are manually staged (e.g. via git-update-index), git-commit should record the commit with updated submodules.
index_differs_from is called from prepare_to_commit with flags set to override_submodule_config = 1.
index_differs_from then merges the default diff flags and passed flags.
When diff.ignoreSubmodules is set to "all", flags ends up having both override_submodule_config and ignore_submodules set to 1. This results in git-commit ignoring staged commits.
This patch restores original flags.ignore_submodule if flags.override_submodule_config is set.
git-<command>asgit <command>. You could just write a shell script that accepts the submodules name, adds it, then issues thesubmodule.<name>.ignoreconfiguration and just call itgit supersubmoduleor something.