{"thread":{"id":"23808","subject":"How to migrate folders using svn:externals exclusively (no actual data inside folder) to git submodules?","startedAt":"2010-05-14T18:53:18Z","lastAt":"2010-05-14T19:17:39Z","messageCount":2,"participants":["Jensen Somers","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"141694","messageId":"AANLkTikJNSPKPDdpYEYVJogPq22LyOr0s3QxEF7wZO1Z@mail.gmail.com","threadId":"23808","inReplyTo":null,"subject":"How to migrate folders using svn:externals exclusively (no actual data inside folder) to git submodules?","fromName":"Jensen Somers","fromEmail":"jensen.somers@gmail.com","sentAt":"2010-05-14T18:53:18Z","receivedAt":"2010-05-14T18:53:18Z","isPatch":false,"sender":{"key":"jensen.somers@gmail.com","avatar":null},"body":"Hello,\n\nHaving used Git a couple of times on some open source projects I am\nbeginning to be more and more convinced of the power and benefit it\nhas over subversion. One of the major benefits for me is the\npossibility to create local branches - and thus work on several things\nat the same time - without interfering with the actual master\nrepository or to have 10 different /trunk folders on my hard drive.\n\nWhere I work we currently use subversion but I am looking into\nmigrating everything to Git. There is one thing that is not very clear\nto me though and I hope somebody could shine some light on the matter.\n\nOur current repository is set up as follows:\n/\n+ /Modules\n+ + /ModuleA\n+ + /ModuleB\n+ + /ModuleC\n+ /Applications\n+ + /ApplicationA\n+ + /ApplicationB\n+ /Views\n+ + /ViewApplicationA\n+ + /ViewApplicationB\n\nViewApplicationA and ViewApplicationB are empty folders which use the\nsvn:externals property to include all required folders. For\nViewApplicationA this would for example be ApplicationA, ModuleA and\nModuleC, for ViewApplicationB this would be ApplicationB, ModuleB and\nModuleC. Using the views the developers are able to checkout only\nwhat's needed for the given project they work on.\nAnd this is where Git confuses me. As an alternative for svn:externals\nI stumbled upon Git submodules but I am not entirely sure they allow\nme to do the same thing. Can I create a sub folder on my root Git\nrepository and let developers check out only that folder or do I need\nto create a separate repository per view and reference another\nrepository (holding all actual data) as a submodule? And can I\nactually do that on the server? Most examples I found talk about\ncloning another repository as a submodule, but all of them seem to do\nit locally, and not on the server and I don't want to bother every\ndeveloper doing all that every time he decides to start fresh.\n\nAny tips, pointers, links to websites and other help to clarify this\nis greatly appreciated.\n\n- Jensen\n"},{"id":"141696","messageId":"4BEDA1D3.3050203@drmicha.warpmail.net","threadId":"23808","inReplyTo":"AANLkTikJNSPKPDdpYEYVJogPq22LyOr0s3QxEF7wZO1Z@mail.gmail.com","subject":"Re: How to migrate folders using svn:externals exclusively (no actual data inside folder) to git submodules?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-14T19:17:39Z","receivedAt":"2010-05-14T19:17:39Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jensen Somers venit, vidit, dixit 14.05.2010 20:53:\n> Hello,\n> \n> Having used Git a couple of times on some open source projects I am\n> beginning to be more and more convinced of the power and benefit it\n> has over subversion. One of the major benefits for me is the\n> possibility to create local branches - and thus work on several things\n> at the same time - without interfering with the actual master\n> repository or to have 10 different /trunk folders on my hard drive.\n> \n> Where I work we currently use subversion but I am looking into\n> migrating everything to Git. There is one thing that is not very clear\n> to me though and I hope somebody could shine some light on the matter.\n> \n> Our current repository is set up as follows:\n> /\n> + /Modules\n> + + /ModuleA\n> + + /ModuleB\n> + + /ModuleC\n> + /Applications\n> + + /ApplicationA\n> + + /ApplicationB\n> + /Views\n> + + /ViewApplicationA\n> + + /ViewApplicationB\n> \n\nWhen I switched from svn to git, the first thing I needed to do was to\n\"think small\": Don't use one big repo for vaguely related things - use\nmany small ones. You see, in git it's so simple to create one, it\ndoesn't even hurt!\n\nI don't think Views, Applications and Modules belong in the same repo here.\n\n> ViewApplicationA and ViewApplicationB are empty folders which use the\n> svn:externals property to include all required folders. For\n> ViewApplicationA this would for example be ApplicationA, ModuleA and\n> ModuleC, for ViewApplicationB this would be ApplicationB, ModuleB and\n> ModuleC. Using the views the developers are able to checkout only\n> what's needed for the given project they work on.\n> And this is where Git confuses me. As an alternative for svn:externals\n> I stumbled upon Git submodules but I am not entirely sure they allow\n> me to do the same thing. Can I create a sub folder on my root Git\n> repository and let developers check out only that folder or do I need\n> to create a separate repository per view and reference another\n> repository (holding all actual data) as a submodule? And can I\n> actually do that on the server? Most examples I found talk about\n> cloning another repository as a submodule, but all of them seem to do\n> it locally, and not on the server and I don't want to bother every\n> developer doing all that every time he decides to start fresh.\n\nAre your Modules interrelated, are your Applications interrelated enough\nso that it makes sense you have branches ModuleX in a repo Modules etc.?\nIf not you may just have one repo per Module and per Application.\n\nViews are a candidate for submodules referencing the Application and\nModule repos they need.\n\nMichael\n"}]}