{"thread":{"id":"18508","subject":"Project With Reusable Libraries","startedAt":"2009-03-24T16:40:06Z","lastAt":"2009-03-25T08:13:39Z","messageCount":2,"participants":["John Dlugosz","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"109226","messageId":"450196A1AAAE4B42A00A8B27A59278E70A5597A8@EXCHANGE.trad.tradestation.com","threadId":"18508","inReplyTo":null,"subject":"Project With Reusable Libraries","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-03-24T16:40:06Z","receivedAt":"2009-03-24T16:40:06Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"Consider a directory tree something like this:\n\n\t...\n\tfoo\\\n\t  bar\\\n\t   project-root\\\n\t     app1\\\n\t         contents of app1\n\t     app2\\\n\t         contents of app2\n\t     lib1\\\n\t         contents of library 1\n\t     lib2\\\n\t         contents of library 2\n\n\nEach project, whether application or library, has its own git repository\nalready.  A program, say app1, is now dependant on the libraries.  The\nlibraries are meant to be used in multiple applications.\n\nThis is not like what is described under subprojects, since the libs are\nnot \"under\" the application, but are peers in the directory structure.\nIt would be wrong to put lib1 and lib2 as subdirectories of app1 because\nthey are also used by app2, right?\n\nThen again... if app1 and app2 are not always built as part of the same\nset, they might have different versions of the libs specified.  I\nunderstand that the newer versions of msysgit do hard linking so having\nmultiple repositories for the same thing won't waste disk space, but\nstill requires fetching to keep them in sync?\n\nAnyway, how would you do it?\n\nTradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.\n  If you received this in error, please contact the sender and delete the material from any computer.\n"},{"id":"109327","messageId":"49C9E7B3.2090206@op5.se","threadId":"18508","inReplyTo":"450196A1AAAE4B42A00A8B27A59278E70A5597A8@EXCHANGE.trad.tradestation.com","subject":"Re: Project With Reusable Libraries","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2009-03-25T08:13:39Z","receivedAt":"2009-03-25T08:13:39Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"John Dlugosz wrote:\n> Consider a directory tree something like this:\n> \n> \t...\n> \tfoo\\\n> \t  bar\\\n> \t   project-root\\\n> \t     app1\\\n> \t         contents of app1\n> \t     app2\\\n> \t         contents of app2\n> \t     lib1\\\n> \t         contents of library 1\n> \t     lib2\\\n> \t         contents of library 2\n> \n> \n> Each project, whether application or library, has its own git repository\n> already.  A program, say app1, is now dependant on the libraries.  The\n> libraries are meant to be used in multiple applications.\n> \n> This is not like what is described under subprojects, since the libs are\n> not \"under\" the application, but are peers in the directory structure.\n> It would be wrong to put lib1 and lib2 as subdirectories of app1 because\n> they are also used by app2, right?\n> \n> Then again... if app1 and app2 are not always built as part of the same\n> set, they might have different versions of the libs specified.  I\n> understand that the newer versions of msysgit do hard linking so having\n> multiple repositories for the same thing won't waste disk space, but\n> still requires fetching to keep them in sync?\n> \n> Anyway, how would you do it?\n> \n\nIf app1 and app2 requires different versions of the same library, I'd\nmake them separate git projects entirely.\n\nIf they have to stay in the same project, I'd put their respective\nlibraries as a submodule under each app. You could get away without\nhaving to fetch them if you stash the lib projects in the super\nproject and then link the app project's lib-submodules to the one\nin the super-project, but it gets messy when you try to explain\nthat without some simple means of drawing things, so if you can't\nwrite a \"sync-submodules\" script, I guess it's not really worth\nthe problem. Especially if the lib-repositories aren't huge.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"}]}