All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] git commit -a doesn't ignore inactive/ignore-all submodules
@ 2021-08-20 17:02 Alexey Izbyshev
  2021-08-24 15:49 ` Alexey Izbyshev
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Izbyshev @ 2021-08-20 17:02 UTC (permalink / raw)
  To: git

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@mail.gmail.com/#t
[2] 
https://superuser.com/questions/1301581/get-git-commit-a-to-ignore-submodules


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-24 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 17:02 [BUG] git commit -a doesn't ignore inactive/ignore-all submodules Alexey Izbyshev
2021-08-24 15:49 ` Alexey Izbyshev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.