[BUG] git commit -a doesn't ignore inactive/ignore-all submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux