Hi,
I've been surprised to discover that "git commit -a" stages submodules
that have been explicitly made inactive via
"submodule.NAME.active=false" and/or hidden from status/diff via
"submodule.NAME.ignore=all":
git init repo
git -C repo commit --allow-empty -m "initial"
git -C repo submodule add "$PWD"/repo
git -C repo commit -m "add sm"
git -C repo config submodule.repo.ignore all
git -C repo config submodule.repo.active false
git -C repo/repo pull
After executing the above commands, "git -C repo commit -a" will show
"repo" in "Changes to be committed" list. I think this behavior is
dangerous because it makes it easy to accidentally "update" the
submodule commit in the main repo while committing other changes. Does
this qualify as a bug?
Reproduced on 2.33 and 2.17.1. Does not reproduce on 2.7.4 (Ubuntu
16.04). This discussion[1] and this question[2] also indicate that "git
commit -a" honored at least "ignore all" setting in older git.
Alexey
[1]
https://public-inbox.org/git/CABxC_L92v=cV=+e_DNa0L6f21LB0BRP5duai2h_heGJN_PRoUQ@xxxxxxxxxxxxxx/#t
[2]
https://superuser.com/questions/1301581/get-git-commit-a-to-ignore-submodules