{"thread":{"id":"46023","subject":"BUG: The .gitignore rules can't be made to cross submodule boundaries","startedAt":"2017-05-22T18:34:00Z","lastAt":"2017-05-23T17:51:12Z","messageCount":4,"participants":["Ævar Arnfjörð Bjarmason","Johannes Schindelin","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"320457","messageId":"CACBZZX41yrAtBvkVeL9Q=2_TxcwrDXh55gu3qLN54P_go318OA@mail.gmail.com","threadId":"46023","inReplyTo":null,"subject":"BUG: The .gitignore rules can't be made to cross submodule boundaries","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-05-22T18:33:33Z","receivedAt":"2017-05-22T18:34:00Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"When I was adding the sha1collisiondetection submodule to git.git I\nnoticed that building git would dirty the submodule.\n\nThis is because our own Makefile adds .depend/ directories. I hacked\naround it by just getting the upstream project accept carrying an\nignore rule for that around:\nhttps://github.com/cr-marcstevens/sha1collisiondetection/commit/e8397b26\n\nA workaround for this is to have the Makefile add such a rule to\n.git/modules/sha1collisiondetection/info/exclude, but that's less\nconvenient than being able to distribute it as a normal .gitignore\nrule.\n\nThe submodule.<name>.ignore config provides an overly big hammer to\nsolve this, it would be better if we had something like\nsubmodule.<name>.gitignore=<path>. Then we could have e.g.\n.gitignore.sha1collisiondetection which would be added to whatever\nrules the repo's own .gitignore provides.\n"},{"id":"320536","messageId":"alpine.DEB.2.21.1.1705231103220.3610@virtualbox","threadId":"46023","inReplyTo":"CACBZZX41yrAtBvkVeL9Q=2_TxcwrDXh55gu3qLN54P_go318OA@mail.gmail.com","subject":"Re: BUG: The .gitignore rules can't be made to cross submodule boundaries","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-23T09:17:28Z","receivedAt":"2017-05-23T09:17:57Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Ævar,\n\nOn Mon, 22 May 2017, Ævar Arnfjörð Bjarmason wrote:\n\n> When I was adding the sha1collisiondetection submodule to git.git I\n> noticed that building git would dirty the submodule.\n> \n> This is because our own Makefile adds .depend/ directories. I hacked\n> around it by just getting the upstream project accept carrying an ignore\n> rule for that around:\n> https://github.com/cr-marcstevens/sha1collisiondetection/commit/e8397b26\n> \n> A workaround for this is to have the Makefile add such a rule to\n> .git/modules/sha1collisiondetection/info/exclude, but that's less\n> convenient than being able to distribute it as a normal .gitignore rule.\n> \n> The submodule.<name>.ignore config provides an overly big hammer to\n> solve this, it would be better if we had something like\n> submodule.<name>.gitignore=<path>. Then we could have e.g.\n> .gitignore.sha1collisiondetection which would be added to whatever rules\n> the repo's own .gitignore provides.\n\nWhile I have nothing but the utmost respect for Stefan and Brandon for\ntrying to improve submodules, maybe it would be a wiser idea to imitate\nthe same strategy with sha1dc as we use with git-gui and gitk, i.e.\nperform a subtree merge instead of adding it as a submodule. It's not like\n570kB will kill us.\n\nCiao,\nDscho"},{"id":"320545","messageId":"CACBZZX5EQhoEBvj2e6ogXU5Y=EfwSPCx+jFvTJ1P2KbYNpADyw@mail.gmail.com","threadId":"46023","inReplyTo":"alpine.DEB.2.21.1.1705231103220.3610@virtualbox","subject":"Re: BUG: The .gitignore rules can't be made to cross submodule boundaries","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-05-23T09:55:07Z","receivedAt":"2017-05-23T09:55:45Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, May 23, 2017 at 11:17 AM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi Ævar,\n>\n> On Mon, 22 May 2017, Ævar Arnfjörð Bjarmason wrote:\n>\n>> When I was adding the sha1collisiondetection submodule to git.git I\n>> noticed that building git would dirty the submodule.\n>>\n>> This is because our own Makefile adds .depend/ directories. I hacked\n>> around it by just getting the upstream project accept carrying an ignore\n>> rule for that around:\n>> https://github.com/cr-marcstevens/sha1collisiondetection/commit/e8397b26\n>>\n>> A workaround for this is to have the Makefile add such a rule to\n>> .git/modules/sha1collisiondetection/info/exclude, but that's less\n>> convenient than being able to distribute it as a normal .gitignore rule.\n>>\n>> The submodule.<name>.ignore config provides an overly big hammer to\n>> solve this, it would be better if we had something like\n>> submodule.<name>.gitignore=<path>. Then we could have e.g.\n>> .gitignore.sha1collisiondetection which would be added to whatever rules\n>> the repo's own .gitignore provides.\n>\n> While I have nothing but the utmost respect for Stefan and Brandon for\n> trying to improve submodules, maybe it would be a wiser idea to imitate\n> the same strategy with sha1dc as we use with git-gui and gitk, i.e.\n> perform a subtree merge instead of adding it as a submodule. It's not like\n> 570kB will kill us.\n\nThe submodule/.gitignore bug/feature-request being reported here isn't\nsomething that impacts the ab/sha1dc series in practice.\n\nIt was something I noticed while working with an earlier commit in\nthat repo, but that's a commit that'll never be pinned by the\ngit.git:sha1collisiondetection submodule.\n"},{"id":"320565","messageId":"CAGZ79kYEASh1cehJ-5=HtevYvpFm6H-aWB+P3VEbXm_o=Go_MQ@mail.gmail.com","threadId":"46023","inReplyTo":"CACBZZX5EQhoEBvj2e6ogXU5Y=EfwSPCx+jFvTJ1P2KbYNpADyw@mail.gmail.com","subject":"Re: BUG: The .gitignore rules can't be made to cross submodule boundaries","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-05-23T17:51:05Z","receivedAt":"2017-05-23T17:51:12Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, May 23, 2017 at 2:55 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Tue, May 23, 2017 at 11:17 AM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n>> Hi Ævar,\n>>\n>> On Mon, 22 May 2017, Ævar Arnfjörð Bjarmason wrote:\n>>\n>>> When I was adding the sha1collisiondetection submodule to git.git I\n>>> noticed that building git would dirty the submodule.\n>>>\n>>> This is because our own Makefile adds .depend/ directories. I hacked\n>>> around it by just getting the upstream project accept carrying an ignore\n>>> rule for that around:\n>>> https://github.com/cr-marcstevens/sha1collisiondetection/commit/e8397b26\n>>>\n>>> A workaround for this is to have the Makefile add such a rule to\n>>> .git/modules/sha1collisiondetection/info/exclude, but that's less\n>>> convenient than being able to distribute it as a normal .gitignore rule.\n>>>\n>>> The submodule.<name>.ignore config provides an overly big hammer to\n>>> solve this, it would be better if we had something like\n>>> submodule.<name>.gitignore=<path>. Then we could have e.g.\n>>> .gitignore.sha1collisiondetection which would be added to whatever rules\n>>> the repo's own .gitignore provides.\n>>\n>> While I have nothing but the utmost respect for Stefan and Brandon for\n>> trying to improve submodules, maybe it would be a wiser idea to imitate\n>> the same strategy with sha1dc as we use with git-gui and gitk, i.e.\n>> perform a subtree merge instead of adding it as a submodule. It's not like\n>> 570kB will kill us.\n\nActually that is a very valid bug report outside that series for the\nbehavior of submodules.\n\nIn a world where you use a submodule to track say a third party\nlibrary, the current behavior of .gitignore applying to each repo makes\nsense.\n\nWhen it is no third party, but a first party lib, then it is sensible to expect\nthat the building/testing infrastructure works across the whole repo set,\nand the user wants just one central place to specify things, such as\nignoring certain files or applying .gitattributes.\n\nThis topic came up in various forms on the mailing list, most often for\nconfig that ought to be applied across all repos[1].\n\nThat said I have no good idea yet how to fix this issue without introducing\nthe ultimate user confusion.\n\nThe conditional include of config files (by Duy as part of 2.13) seems like\nan interesting approach, which we could build on top of.\nWe currently have a main config and a per-working-tree config, so I would\nexpect we'd introduce another config file that is included by all submodules\nby default. It could be located in the superproject at \".git/config.super\".\nThis config file could then specify\n\n[submodule]\n    recursiveIgnore = [yes/no]\n    recursiveAttributes = [yes/no]\n\nIn that way commands run from within the submodule as well as from\nthe superproject would realize that the submodule needs to lookup\nthe superproject and use the attribute/ignore/config settings from there.\n\n[1] Here the example for URL.insteadOf\nhttps://public-inbox.org/git/CAPZ477MCsBsfbqKzp69MT_brwz-0aes6twJofQrhizUBV7ZoeA@mail.gmail.com/\n\n>\n> The submodule/.gitignore bug/feature-request being reported here isn't\n> something that impacts the ab/sha1dc series in practice.\n>\n> It was something I noticed while working with an earlier commit in\n> that repo, but that's a commit that'll never be pinned by the\n> git.git:sha1collisiondetection submodule.\n\nThanks for the bug report. As outlined above, we'd still need to bikeshed\nhow to fix it properly I'd think.\n\nThanks,\nStefan\n"}]}