{"thread":{"id":"23068","subject":"How to start well for a special git construction","startedAt":"2010-03-18T19:26:53Z","lastAt":"2010-03-19T20:48:18Z","messageCount":4,"participants":["bruno le hyaric","Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137122","messageId":"e8be804e1003181226y20328151s75641f4341ca12d8@mail.gmail.com","threadId":"23068","inReplyTo":null,"subject":"How to start well for a special git construction","fromName":"bruno le hyaric","fromEmail":"bruno.lehyaric@gmail.com","sentAt":"2010-03-18T19:26:53Z","receivedAt":"2010-03-18T19:26:53Z","isPatch":false,"sender":{"key":"bruno.lehyaric@gmail.com","avatar":null},"body":"Hi,\n\nI'm working on an e-commerce development project based on Ruby on Rails.\n\n\n\nOn the left hand, I use one framework : Spree ;\non the other hand , I use Flex generation with another framework : RestfulX;\non my third hand ^^, I want to merge both in a third directory.\n\nBasically, my root folder contains one directory for each : ./spree,\n./restfulx, ./merge\n\n\n\nThe merge is a bit special, because Spree is a framework wich provide\nextension feature, and Spree extensions are located in\n./spree/vendor/extensions/extension_name. I want to merge resttfulx\nfolder as a spree extension (I heard about git-module, is this the\ngood way to solve my problem?)\n\n\n\nMoreover, in both folder ./spree and ./restfulx I wan't to manage all\nfiles with git (except databases and logs), but in ./restfulx there\nare only few files I need to merge in ./merge. Those files are the\nresult of code generation from RestfulX. So I think I have to use\nbranch, one with all files, one which only contains files to 'deliver'\nin ./merge.\n\nIn my current vision of git, I think branches are used for parallel\ndevelopments and are merged together after. In other words, in my\ncompany I'm used to use ClearCase, and to have a development stream,\nan integration stream and a release one, in the release stream, we\nonly deliver executable files, not all source code... I don't know if\nGit branches can be seen as Clearcase streams...\n\n\n\nActually, I'm not in the company and I try to build the same\ndevelopment process automated with git with framework installation\n(Spree), code generation (RestfulX) and integration (./merge).\n\nAny advice on how to start will be very helpful.\nDo I need several repositories?\nCan I use Git-plugins to integrate ./restfulx at a special location in ./merge?\nCan I merge only specific files from a repository?\n\n\nBest regards,\n\nBruno.\n\n---------------------------------------------------------------------------\n----------------------------------------------------------\nSpree mailing list, this topic :\nhttp://groups.google.com/group/spree-user/browse_thread/thread/4797e4...\nRestfulX mailing list, this topic :\nhttp://groups.google.com/group/restfulx-framework/browse_thread/threa...\n"},{"id":"137140","messageId":"32541b131003181348j1e7d5dfamec09bed2c81916d8@mail.gmail.com","threadId":"23068","inReplyTo":"e8be804e1003181226y20328151s75641f4341ca12d8@mail.gmail.com","subject":"Re: How to start well for a special git construction","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-03-18T20:48:52Z","receivedAt":"2010-03-18T20:48:52Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Mar 18, 2010 at 3:26 PM, bruno le hyaric\n<bruno.lehyaric@gmail.com> wrote:\n> On the left hand, I use one framework : Spree ;\n> on the other hand , I use Flex generation with another framework : RestfulX;\n> on my third hand ^^, I want to merge both in a third directory.\n\nI think you might have skipped past describing your problem and jumped\nstraight to describing your solution.\n\nDo you actually have multiple projects that you're working on, or are\nyou the maintainer of an application that uses other people's\nprojects?  Do you want to make patches to these other subprojects\n(Spree and RestfulX) and distribute them upstream, or do you just want\nto use their upstream versions verbatim?  Do you want to patch their\nprojects and *not* distribute your patches upstream?  Do you expect to\nupdate your copies of those projects frequently or rarely?\n\nAre you planning to distribute copies of your source code, your\nfinished product, or both?  Ruby on Rails apps usually don't have\nanything *but* the source code, but in that case, I'm not sure why you\nmention Clearcase and not including the source code in release\nstreams.\n\nThere are a lot of variables here and it's hard to give good advice\nunless we have a clearer understanding of what you actually want to\naccomplish.\n\nHave fun,\n\nAvery\n"},{"id":"137265","messageId":"e8be804e1003191330w70d9827cr1cfc1f46a5f45a2a@mail.gmail.com","threadId":"23068","inReplyTo":"32541b131003191259j1208118ayca6c79c21cae2291@mail.gmail.com","subject":"Re: How to start well for a special git construction","fromName":"bruno le hyaric","fromEmail":"bruno.lehyaric@gmail.com","sentAt":"2010-03-19T20:30:20Z","receivedAt":"2010-03-19T20:30:20Z","isPatch":false,"sender":{"key":"bruno.lehyaric@gmail.com","avatar":null},"body":"Thanks for your help.\nI've just created my empty new branch for delivery stuff... and\neffectively the branch is empty :-D\nAny idea on how I can add executable files in this empty branch from\nthe master branch? Is that possible?\n(perhaps I'm using Git in a bad way)\n\nIf I want to manage those file with Git, it's just for the purpose to\nmerge them in another repository. I would have choose to have only one\nrepository for all things... but basically, the two frameworks are not\nmaid to be used together. So I thought that using two distinct\nrepositories was better. Especially for Restfulx code generation which\nneed a lot of unsalubrious hacks. I don't want to keep them in my\nfinal application...\n\nin any case, thank you very much for your quick answers.\n\n\nBruno\n\n2010/3/19, Avery Pennarun <apenwarr@gmail.com>:\n> On Fri, Mar 19, 2010 at 3:31 PM, bruno le hyaric\n> <bruno.lehyaric@gmail.com> wrote:\n>> 2010/3/18, Avery Pennarun <apenwarr@gmail.com>:\n>>> Do you actually have multiple projects that you're working on, or are\n>>> you the maintainer of an application that uses other people's\n>>> projects?\n>>\n>> I'm starting building a new web application based on 2 existing\n>> frameworks (Spree, RestfulX).\n>\n> This basic explanation leads me to believe you only really want one\n> repo (at least once you have it set up): the one for your app.  Other\n> people already host repos for the other projects.\n>\n>> I want to use latest upstream of both frameworks. For the moment I\n>> don't have reason to make patches for these, but if I can do that,\n>> this is better. In the other case I can imagine developping patch in\n>> distinct repository in a independant way...\n>\n> You can embed the contents of the other repositories into yours in one\n> of three ways that I know of:\n>\n> - Just copy the files from those libraries into your project's repo.\n> This is cheap and easy, although it makes it a bit harder to push\n> patches upstream later, in case you care about that.\n>\n> - Use git-submodule to import those libraries into your project's\n> repo.  This is reasonably easy, but makes it hard to patch those\n> libraries without creating additional repositories, which is\n> inconvenient.  If you don't need to patch those libraries, it's the\n> cleanest way.\n>\n> - Use git-subtree to import those libraries into your project's repo.\n> This makes it relatively easy to push and pull changes from the\n> libraries from/to upstream, but can clutter up your 'git log' a bit.\n>\n> I expect that for your purposes, any of the three options would work fine.\n>\n>> I plan to distribute the basic work needed by my application.\n>> Basically, I'm building an automated process to get a e-commerce\n>> website with generated Flex (Flash) views. This process is mainly\n>> based on Git/Shell/Rake/Ruby commands.\n>>\n>> I won't distribute the source code of my own e-commerce website.\n>>\n>> But my problem wasn't about redistribution... RestfulX is a tool for\n>> code generation. It needs some input and generate Flex code as output.\n>> Then I compile Flex code to get a Flash executable (.swf / .swc). I\n>> want to manage everything with versionning, but regarding the merge, I\n>> just want to merge the executable in the destination repository, not\n>> all the stuff used for code generation.\n>\n> It's very rare with git to commit your output files into a repository.\n>  You can do it, but it's rare.  Most people just put the numbered\n> binaries up in a directory on a website somewhere.  Version\n> controlling binaries any other way doesn't really add anything, since\n> 'git diff' and friends aren't much help, and the output files are (by\n> definition) possible to reconstruct from the source code, so if you\n> lose them, it's not a big deal.\n>\n> If you really want to do it, then you will probably want to at least\n> put the output files on their own branch (as you suggest) or even into\n> their own repository (so that people cloning the source repo don't\n> have to download tons of binary revisions that they won't be using).\n>\n> Hope this helps.\n>\n> Have fun,\n>\n> Avery\n>\n"},{"id":"137266","messageId":"32541b131003191348q71a922d9nf9e295cbec6716a9@mail.gmail.com","threadId":"23068","inReplyTo":"e8be804e1003191330w70d9827cr1cfc1f46a5f45a2a@mail.gmail.com","subject":"Re: How to start well for a special git construction","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-03-19T20:48:18Z","receivedAt":"2010-03-19T20:48:18Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Fri, Mar 19, 2010 at 4:30 PM, bruno le hyaric\n<bruno.lehyaric@gmail.com> wrote:\n> Thanks for your help.\n> I've just created my empty new branch for delivery stuff... and\n> effectively the branch is empty :-D\n> Any idea on how I can add executable files in this empty branch from\n> the master branch? Is that possible?\n> (perhaps I'm using Git in a bad way)\n\nThere are fancy things you can do to create a branch containing only a\nsingle file without checking it out.  It's a bit advanced, but it\nlooks something like this:\n\n    FILENAME=path/to/file\n    BASENAME=$(basename $FILENAME)\n    BLOBID=$(cat $FILENAME | git hash-object --stdin -w)\n    TREEID=$(printf '100644 blob %s\\t%s' $BLOBID $BASENAME | git mktree)\n    COMMITID=$(echo Commit Message | git commit-tree $TREEID -p\nrefs/heads/release-branch)\n    git update-ref refs/heads/release-branch $COMMITID\n\nA more straightforward way to do it would be to clone your repository,\nand check out the release branch in your clone, then copy the file to\nit and commit as you normally would.\n\nHave fun,\n\nAvery\n"}]}