On Wed, Jun 14, 2023 at 12:37 PM Josip Sokcevic <sokcevic@xxxxxxxxxx> wrote: > 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. > > Signed-off-by: Josip Sokcevic <sokcevic@xxxxxxxxxx> Looking much better. Just a minor (nitpicky) style comment... > diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh > @@ -1179,4 +1179,27 @@ test_expect_success 'submodule update --recursive skip submodules with strategy= > +add_submodule_commit_and_validate () { > + HASH=$(git rev-parse HEAD) && > + git update-index --add --cacheinfo 160000,$HASH,sub && > + git commit -m "create submodule" && > + echo "160000 commit $HASH sub" > expect && Drop the space after the redirection operator: echo "160000 commit $HASH sub" >expect && > + git ls-tree HEAD -- sub >actual && This one correctly omits whitespace after the redirection operator. > + test_cmp expect actual > +}