{"thread":{"id":"29493","subject":"Project structure of .NET-Projects using git submodule or something different","startedAt":"2012-01-31T22:41:23Z","lastAt":"2012-02-10T17:03:08Z","messageCount":4,"participants":["Harald Heigl","Jens Lehmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"183439","messageId":"002401cce069$75ecc1a0$61c644e0$@heigl-online.at","threadId":"29493","inReplyTo":null,"subject":"Project structure of .NET-Projects using git submodule or something different","fromName":"Harald Heigl","fromEmail":"harald@heigl-online.at","sentAt":"2012-01-31T22:41:23Z","receivedAt":"2012-01-31T22:41:23Z","isPatch":false,"sender":{"key":"harald@heigl-online.at","avatar":null},"body":"Hi, I'm searching for an adequate Project-structure for our .NET-Projects,\nbut I think the problem isn't specific to .NET-Programs, it's more \"how can\nI nest submodules toghether\".\n\nLet's assume following Project structure (Dependencies and Subdependencies\nare submodules and submodules of the submodules)\nProject\n\tDependency 1\n\t\tDependency 2\n\t\tDependency 3\n\tDependency 4\n\tDependency 2\n\n\nThe problem is if I want to build them I need to build 2+3, then 1, 4 and 2\nagain and then the project. As you may see project 2 is a submodule of\ndependency 1 and also of project. I don't feel comfortable with this setup.\nWhat do you think?\nI've also thought about symlinks (though I'm mainly on Windows ), but with\nsymlinks I'll lose the tight coupling of git submodules by SHA1-revision.\nI could also add Dependency 1-4 to my main project, not loading submodule\n2-3 within  dependency 1, but then the Project-Files of .NET for dependency1\nmay change depending if I clone Dependency1 on its own or if I clone my\nsuperproject.\n\nSometimes I have longer chains (project - submodule - subsubmodule - . ), so\nit could easily be that I clone a superproject and 10 subprojects, even\nthough there are only 3-5 really different subprojects, rest would be\nduplicates.\n\nHow would you handle this? Git submodules? Something different? \n\nThanks in advance,\nHarald\n"},{"id":"183493","messageId":"4F29A0BE.8000803@web.de","threadId":"29493","inReplyTo":"002401cce069$75ecc1a0$61c644e0$@heigl-online.at","subject":"Re: Project structure of .NET-Projects using git submodule or something different","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-02-01T20:29:50Z","receivedAt":"2012-02-01T20:29:50Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 31.01.2012 23:41, schrieb Harald Heigl:\n> Let's assume following Project structure (Dependencies and Subdependencies\n> are submodules and submodules of the submodules)\n> Project\n> \tDependency 1\n> \t\tDependency 2\n> \t\tDependency 3\n> \tDependency 4\n> \tDependency 2\n> \n> \n> The problem is if I want to build them I need to build 2+3, then 1, 4 and 2\n> again and then the project. As you may see project 2 is a submodule of\n> dependency 1 and also of project. I don't feel comfortable with this setup.\n> What do you think?\n\nHmm, we try to avoid that kind of setup as having checked out different\nversions of the \"Dependency 2\" submodule could have rather surprising\neffects. We get along really well with \"Dependency 2\" only being present\nin the superproject and having \"Dependency 1\" reference that instead of\nhaving its own copy (So we have submodules which are depending on having\nother submodules right next to them). Then the superproject is responsible\nfor tying it all together.\n"},{"id":"183502","messageId":"000601cce125$808b3cb0$81a1b610$@heigl-online.at","threadId":"29493","inReplyTo":"4F29A0BE.8000803@web.de","subject":"AW: Project structure of .NET-Projects using git submodule or something different","fromName":"Harald Heigl","fromEmail":"harald@heigl-online.at","sentAt":"2012-02-01T21:07:26Z","receivedAt":"2012-02-01T21:07:26Z","isPatch":false,"sender":{"key":"harald@heigl-online.at","avatar":null},"body":"Hi, thanks for your answer!\n\n> -----Ursprüngliche Nachricht-----\n> Von: Jens Lehmann [mailto:Jens.Lehmann@web.de]\n> Gesendet: Mittwoch, 01. Februar 2012 21:30\n> An: Harald Heigl\n> Cc: git@vger.kernel.org\n> Betreff: Re: Project structure of .NET-Projects using git submodule or\n> something different\n> \n> Am 31.01.2012 23:41, schrieb Harald Heigl:\n> > Let's assume following Project structure (Dependencies and\n> Subdependencies\n> > are submodules and submodules of the submodules)\n> > Project\n> > \tDependency 1\n> > \t\tDependency 2\n> > \t\tDependency 3\n> > \tDependency 4\n> > \tDependency 2\n> >\n> >\n> > The problem is if I want to build them I need to build 2+3, then 1, 4\nand 2\n> > again and then the project. As you may see project 2 is a submodule of\n> > dependency 1 and also of project. I don't feel comfortable with this\nsetup.\n> > What do you think?\n> \n> Hmm, we try to avoid that kind of setup as having checked out different\n> versions of the \"Dependency 2\" submodule could have rather surprising\n> effects. We get along really well with \"Dependency 2\" only being present\n> in the superproject and having \"Dependency 1\" reference that instead of\n> having its own copy (So we have submodules which are depending on having\n> other submodules right next to them). Then the superproject is responsible\n> for tying it all together.\n\nI think you're right, my first thoughts were that if I start a new project I\njust \"git submodule dependency1\" and get all the required dependencies and\nthe dependencies within the dependencies and so on ... . \nWith your solution I \"git submodule dependency1\" and have to think about the\ndependencies it depends on. On the other hand we are just a small company\nand the number of submodules is not too big and the missing references in a\nnew project would be easily identifiable, so ... .\n\nAnd if I want to checkout dependency 1 individually (for whatever reason), I\ncould still do something like this:\nSuperDependency1 (with solution-File)\n           Dependency1 (as submodule)\n           Dependency2 (dependency of dependency1 - as submodule)\n           Dependency3 (dependency of dependency1 - as submodule)\n\nThanks again, I see my concept causes some trouble ...\n\nAny other thoughts or other workflows with git or with tools build around\ngit?\n\nThanks again,\nHarald\n"},{"id":"184366","messageId":"003401cce815$dd907190$98b154b0$@heigl-online.at","threadId":"29493","inReplyTo":"4F29A0BE.8000803@web.de","subject":"AW: Project structure of .NET-Projects using git submodule or something different","fromName":"Harald Heigl","fromEmail":"harald@heigl-online.at","sentAt":"2012-02-10T17:03:08Z","receivedAt":"2012-02-10T17:03:08Z","isPatch":false,"sender":{"key":"harald@heigl-online.at","avatar":null},"body":"Hi,\n\nJust another question: What if your dependency is used in many projects?\nFor example if you use it in 10 projects it will be checked out 10 times.\nWell you could always do a push (and a pull in all other 9 projects to not\nforget them).\nOk 10 projects is quite much, but I sometimes have 2-4 projects in parallel\nwhich sometimes use the same dependencies. (And change them in the projects\non demand)\nI've thought about checking out the dependency only once and do hardlinking,\nI've also read about the \"git clone --shared\", but with both methods I would\nloose the advantage of using submodule and on the other side I don't know\nexactly which problems could arise.\n\nCould I just say that submodules would be checked out to a central location\nor are there better possibilities?\nI don't mind the disk space, I just wonder how to keep track if you have\nsome projects all using the same dependencies.\n\nThanks,\nHarald\n\n> -----Ursprüngliche Nachricht-----\n> Von: Harald Heigl [mailto:Harald@heigl-online.at]\n> Gesendet: Mittwoch, 01. Februar 2012 22:07\n> An: 'git@vger.kernel.org'\n> Betreff: AW: Project structure of .NET-Projects using git submodule or\n> something different\n> \n> Hi, thanks for your answer!\n> \n> > -----Ursprüngliche Nachricht-----\n> > Von: Jens Lehmann [mailto:Jens.Lehmann@web.de]\n> > Gesendet: Mittwoch, 01. Februar 2012 21:30\n> > An: Harald Heigl\n> > Cc: git@vger.kernel.org\n> > Betreff: Re: Project structure of .NET-Projects using git submodule or\n> > something different\n> >\n> > Am 31.01.2012 23:41, schrieb Harald Heigl:\n> > > Let's assume following Project structure (Dependencies and\n> > Subdependencies\n> > > are submodules and submodules of the submodules)\n> > > Project\n> > > \tDependency 1\n> > > \t\tDependency 2\n> > > \t\tDependency 3\n> > > \tDependency 4\n> > > \tDependency 2\n> > >\n> > >\n> > > The problem is if I want to build them I need to build 2+3, then 1, 4\nand 2\n> > > again and then the project. As you may see project 2 is a submodule of\n> > > dependency 1 and also of project. I don't feel comfortable with this\n> setup.\n> > > What do you think?\n> >\n> > Hmm, we try to avoid that kind of setup as having checked out different\n> > versions of the \"Dependency 2\" submodule could have rather surprising\n> > effects. We get along really well with \"Dependency 2\" only being present\n> > in the superproject and having \"Dependency 1\" reference that instead of\n> > having its own copy (So we have submodules which are depending on\n> having\n> > other submodules right next to them). Then the superproject is\n> responsible\n> > for tying it all together.\n> \n> I think you're right, my first thoughts were that if I start a new project\nI just\n> \"git submodule dependency1\" and get all the required dependencies and\n> the dependencies within the dependencies and so on ... .\n> With your solution I \"git submodule dependency1\" and have to think about\n> the dependencies it depends on. On the other hand we are just a small\n> company and the number of submodules is not too big and the missing\n> references in a new project would be easily identifiable, so ... .\n> \n> And if I want to checkout dependency 1 individually (for whatever reason),\nI\n> could still do something like this:\n> SuperDependency1 (with solution-File)\n>            Dependency1 (as submodule)\n>            Dependency2 (dependency of dependency1 - as submodule)\n>            Dependency3 (dependency of dependency1 - as submodule)\n> \n> Thanks again, I see my concept causes some trouble ...\n> \n> Any other thoughts or other workflows with git or with tools build around\n> git?\n> \n> Thanks again,\n> Harald\n"}]}