{"thread":{"id":"47722","subject":"git add --all does not respect submodule.<name>.ignore","startedAt":"2018-01-30T20:25:37Z","lastAt":"2018-01-30T23:38:45Z","messageCount":3,"participants":["Michael Scott-Nelson","Stefan Beller","Jacob Keller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"337804","messageId":"CAMZgS+GT8pSx8rDy1KmzFV3LObA_bAkw25LMz5Oodb88QOXY5A@mail.gmail.com","threadId":"47722","inReplyTo":null,"subject":"git add --all does not respect submodule.<name>.ignore","fromName":"Michael Scott-Nelson","fromEmail":"mscottnelson@gmail.com","sentAt":"2018-01-30T20:25:31Z","receivedAt":"2018-01-30T20:25:37Z","isPatch":false,"sender":{"key":"mscottnelson@gmail.com","avatar":null},"body":"Giving a submodule \"ignore=all\" or \"ignore=dirty\" in .gitmodule\nsuccessfully removes that module from `git status` queries. However,\nthese same diffs are automatically added by git-add, eg `git add .` or\n`git add --all` adds the submodules that we want ignored. This seems\ninconsistent and confusing.\n\nWorkflow reason:\nWe want to be able to have supers and subs checked-out, make changes\nto both, but only update the SHA-1 pointer from super to sub when\nexplicitly forced to do so, eg `git add -f subName`. This workflow\nprevents continuous merge conflicts from clashing SHA-1 pointers while\nstill allowing `git add --all`, allowing a sort of middle ground\nbetween submodules and an untracked library.\n\nTeaching git-add about submodule.ignore and/or teaching .gitignore\nabout submodules would be awesome.\n\nAlso experimented with `git update-index --assume-unchanged subName`,\nbut I believe that it does not get committed and besides also does not\nseem to have a way to `git add -f`.\n---\nNote: currently on git version 2.14.1, but looking through the\nchangelogs, did not see any changes since then that would enable this\nworkflow.\n\n-Michael Scott-Nelson\n"},{"id":"337845","messageId":"CAGZ79kYBhBbn3vs2pHGuVzBo79EjUVmUR4r2z5GexNFOVxfv7g@mail.gmail.com","threadId":"47722","inReplyTo":"CAMZgS+GT8pSx8rDy1KmzFV3LObA_bAkw25LMz5Oodb88QOXY5A@mail.gmail.com","subject":"Re: git add --all does not respect submodule.<name>.ignore","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-01-30T21:56:13Z","receivedAt":"2018-01-30T21:56:21Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Jan 30, 2018 at 12:25 PM, Michael Scott-Nelson\n<mscottnelson@gmail.com> wrote:\n> Giving a submodule \"ignore=all\" or \"ignore=dirty\" in .gitmodule\n> successfully removes that module from `git status` queries. However,\n> these same diffs are automatically added by git-add, eg `git add .` or\n> `git add --all` adds the submodules that we want ignored. This seems\n> inconsistent and confusing.\n\nMy prime suspect for this change would be\nhttps://github.com/git/git/commit/5556808690ea245708fb80383be5c1afee2fb3eb\n\n> Workflow reason:\n> We want to be able to have supers and subs checked-out, make changes\n> to both, but only update the SHA-1 pointer from super to sub when\n> explicitly forced to do so, eg `git add -f subName`. This workflow\n> prevents continuous merge conflicts from clashing SHA-1 pointers while\n> still allowing `git add --all`, allowing a sort of middle ground\n> between submodules and an untracked library.\n\nFor that you want to set the ignore flag locally in .git/config instead of\n.gitmodules. The .gitmodules seems like a convenient place to \"share\nsubmodule config\", but that is a slippery slope and I think that was a\nmistake by the project.\n\n(If you control the environment, you could also put the ignore flags into\nthe system wide config)\n\n> Teaching git-add about submodule.ignore and/or teaching .gitignore\n> about submodules would be awesome.\n\nI wonder if we can address this issue with even more config options.\n(sounds bad, but is the first thought I have)\n\n> Also experimented with `git update-index --assume-unchanged subName`,\n> but I believe that it does not get committed and besides also does not\n> seem to have a way to `git add -f`.\n\nThe assume-unchanged bit is a performance optimisation for powerusers,\nbut its documentation words it in a less dangerous way, such that it sounds\nas if it is a UX feature instead of a performance thing. I'd stay away from\nthat know.\n\nStefan\n"},{"id":"337859","messageId":"CA+P7+xr6JAsxat9D1zZmxgSCQuLZ7On=4zK4aZFFdGG8RR=_RA@mail.gmail.com","threadId":"47722","inReplyTo":"CAGZ79kYBhBbn3vs2pHGuVzBo79EjUVmUR4r2z5GexNFOVxfv7g@mail.gmail.com","subject":"Re: git add --all does not respect submodule.<name>.ignore","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2018-01-30T23:38:19Z","receivedAt":"2018-01-30T23:38:45Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Jan 30, 2018 at 1:56 PM, Stefan Beller <sbeller@google.com> wrote:\n> The assume-unchanged bit is a performance optimisation for powerusers,\n> but its documentation words it in a less dangerous way, such that it sounds\n> as if it is a UX feature instead of a performance thing. I'd stay away from\n> that know.\n>\n> Stefan\n\nIn almost all cases where someone incorrectly recommends\nassume-unchanged, I think they could just use skip-worktree to get the\nactual behavior they want.\n\nThanks,\nJake\n"}]}