{"thread":{"id":"21425","subject":"Projects within projects","startedAt":"2009-10-29T18:40:36Z","lastAt":"2009-10-29T19:33:51Z","messageCount":3,"participants":["Nick Colgan","Avery Pennarun","Bill Lear"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"126322","messageId":"ab1d51700910291140ncd80027j4ee9a30637d7bc40@mail.gmail.com","threadId":"21425","inReplyTo":null,"subject":"Projects within projects","fromName":"Nick Colgan","fromEmail":"nick.colgan@gmail.com","sentAt":"2009-10-29T18:40:36Z","receivedAt":"2009-10-29T18:40:36Z","isPatch":false,"sender":{"key":"nick.colgan@gmail.com","avatar":null},"body":"I'm currently working on a project made up of parts that could each be\nconsidered a project in itself. I plan on using redmine or trac to\nmanage the project. Now I'm trying to figure out how to manage the\nrepo(s) for the project.\n\nThese are the current options I have in mind:\n\n1. Create a separate repository for each sub-project and manage each\nseparately in redmine (separate bug tracker, wiki, etc.)\n\n2. Create a single repository with a subdirectory for each sub-project.\n\n3. Use git submodules or subversion externals to combine options 1 and 2\nby creating a separate repo for each sub-project, then creating a master\nrepo with subdirectory for each sub-project that imports from their\nrespective repositories.\n\nWhat's the best way to handle this situation? Are git submodules and/or\nsvn externals sufficiently capable of dealing with this?\n\nThanks,\nnic.\n"},{"id":"126325","messageId":"32541b130910291156w693a188dv6dfd0d39a506d145@mail.gmail.com","threadId":"21425","inReplyTo":"ab1d51700910291140ncd80027j4ee9a30637d7bc40@mail.gmail.com","subject":"Re: Projects within projects","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-10-29T18:56:36Z","receivedAt":"2009-10-29T18:56:36Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Oct 29, 2009 at 2:40 PM, Nick Colgan <nick.colgan@gmail.com> wrote:\n> These are the current options I have in mind:\n>\n> 1. Create a separate repository for each sub-project and manage each\n> separately in redmine (separate bug tracker, wiki, etc.)\n>\n> 2. Create a single repository with a subdirectory for each sub-project.\n>\n> 3. Use git submodules or subversion externals to combine options 1 and 2\n> by creating a separate repo for each sub-project, then creating a master\n> repo with subdirectory for each sub-project that imports from their\n> respective repositories.\n>\n> What's the best way to handle this situation? Are git submodules and/or\n> svn externals sufficiently capable of dealing with this?\n\nEvery way has tradeoffs.  I'd suggest first thinking about whether\nthese supposedly independent projects are *really* going to be\nindependent or not.  If they're unlikely to ever be reused - or they\nwon't be for a long time - #2 is by far the easiest choice.\n\nIf you choose #2 and then choose to split the repo later, you can use\ngit-subtree (http://github.com/apenwarr/git-subtree) to split it\neasily, so there's little sacrifice in using #2 at first and changing\nyour mind later.\n\nIf you choose #3, that's exactly that git-submodule and svn:externals\nare for, and it seems to work okay for a lot of people.  It's more\nwork though, since you have to be careful to isolate commits between\none project and another, etc. Personally I prefer to use git-subtree\nfor this too, but it's a matter of preference.\n\nHave fun,\n\nAvery\n"},{"id":"126326","messageId":"19177.60959.457301.349805@lisa.zopyra.com","threadId":"21425","inReplyTo":"ab1d51700910291140ncd80027j4ee9a30637d7bc40@mail.gmail.com","subject":"Re: Projects within projects","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2009-10-29T19:33:51Z","receivedAt":"2009-10-29T19:33:51Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Thursday, October 29, 2009 at 14:40:36 (-0400) Nick Colgan writes:\n>I'm currently working on a project made up of parts that could each be\n>considered a project in itself. I plan on using redmine or trac to\n>manage the project. Now I'm trying to figure out how to manage the\n>repo(s) for the project.\n>\n>These are the current options I have in mind:\n>\n>1. Create a separate repository for each sub-project and manage each\n>separately in redmine (separate bug tracker, wiki, etc.)\n>\n>2. Create a single repository with a subdirectory for each sub-project.\n>\n>3. Use git submodules or subversion externals to combine options 1 and 2\n>by creating a separate repo for each sub-project, then creating a master\n>repo with subdirectory for each sub-project that imports from their\n>respective repositories.\n>\n>What's the best way to handle this situation? Are git submodules and/or\n>svn externals sufficiently capable of dealing with this?\n\nLet me give you an example of #3.  I write a fair amount in C++ and\nhave written a reasonably sophisticated makefile system to allow me to\ncreate a new directory in a project, put files in it, link in a master\nmakefile, cd into the directory and type 'make' and have things build\nwithout me having to edit the makefile --- I don't want to write\nmakefile rules, etc., I want to write C++ (fill in the blank here).\nIt basically relies on naming conventions, but it suits me perfectly.\nIf I name a file test_*.cc or t_*.cc, or tc_*.cc, it is a unit test,\nif I name it m_*.cc, or main_*.cc, it is a main program.  Library\ninter-dependencies are easy to set up in a central way, blah blah blah\n--- the details are not terribly important.\n\nIn any case, I created a new project to work on some \"real-time\"\nfinancial trading algorithms.  I did this by creating a new repository\ninto which I added a src directory, under which were several other\ndirectories of source code.  At the top level of the new repo, I added\na git submodule 'mk' that contains my makefile system.  I then linked\nthe master makefile to my source directory makefile and was off\ncompiling easily.\n\nIn this case, I do absolutely reuse my makefile system across multiple\nprojects.  It is 100% orthogonal, and I have so far found it to be\nvery useful to use git submodules.\n\nI imagine also if you are building software that is 100% orthogonal\nthat you would like to reuse in many projects, git submobules is the\nway to go.\n\nI read the Git Submodule Tutorial on the Git Wiki and found myself\nable to use submodules very easily after that.\n\n\nbill\n"}]}