{"thread":{"id":"24931","subject":"Additional remote on a local clone. Where do the objects go?","startedAt":"2010-09-01T07:12:59Z","lastAt":"2010-09-05T23:50:59Z","messageCount":6,"participants":["Stephen Kelly","Tay Ray Chuan","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"149534","messageId":"i5kudr$dp7$1@dough.gmane.org","threadId":"24931","inReplyTo":null,"subject":"Additional remote on a local clone. Where do the objects go?","fromName":"Stephen Kelly","fromEmail":"steveire@gmail.com","sentAt":"2010-09-01T07:12:59Z","receivedAt":"2010-09-01T07:12:59Z","isPatch":false,"sender":{"key":"steveire@gmail.com","avatar":null},"body":"Hi,\n\nI have done something like this :\n\ngit clone git://gitorious.org/qt/qt.git qtrepo\ncd qtrepo\ngit checkout -b 4.7 origin/4.7\ngit checkout -b 4.6 origin/4.6\ngit clone qtrepo qt46\ncd qt46 && git checkout -b 4.6 origin/4.6\ncd ..\ngit clone qtrepo qt47\ncd qt46 && git checkout -b 4.7 origin/4.7\ncd ..\n\nThe aim is to have multiple local checkouts of different branches of Qt \nwhile sharing the same object store. However, it is inconvenient to have to \npull in the qtrepo directory, then cd to the other two to get the changes.\n\nIt would be more convenient to be able to add the qt.git remote to the local \nclones, pull from it, and have the pulled objects shared in the same object \nstore. Is that possible or is it what already happens? I will also want to \nadd additional remotes for pushing changes to from the local clones.\n\nAll the best,\n\nSteve.\n"},{"id":"149549","messageId":"AANLkTi=_uP_zFOV_k=cM8TXH16kTPAoPGpNkz+QUSzb-@mail.gmail.com","threadId":"24931","inReplyTo":"i5kudr$dp7$1@dough.gmane.org","subject":"Re: Additional remote on a local clone. Where do the objects go?","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-09-01T10:32:39Z","receivedAt":"2010-09-01T10:32:39Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Wed, Sep 1, 2010 at 3:12 PM, Stephen Kelly <steveire@gmail.com> wrote:\n> git clone git://gitorious.org/qt/qt.git qtrepo\n> cd qtrepo\n> git checkout -b 4.7 origin/4.7\n> git checkout -b 4.6 origin/4.6\n> git clone qtrepo qt46\n> cd qt46 && git checkout -b 4.6 origin/4.6\n> cd ..\n> git clone qtrepo qt47\n> cd qt46 && git checkout -b 4.7 origin/4.7\n> cd ..\n\nTwo improvements: shared objects, and configuring git-pull:\n\n  git clone git://gitorious.org/qt/qt.git qtrepo\n  git init qt46\n  PARENT_GIT=$(pwd)/qtrepo/.git\n  cd qt46\n\n  # use of shared objects - tell git where to find the \"missing\" objects\n  cat $PARENT_GIT/objects > .git/objects/info/alternates\n\n  # setup of git pull\n  cat <<EOF >> .git/config\n[remote \"parent\"]\n  url = $PARENT_GIT\n[branch \"master\"]\n  remote = parent\n  merge = refs/remotes/origin/4.6\nEOF\n\n  # done!\n  git pull\n\nRepeat for 4.7.\n\nIf you want to go one step further and track these repos, you could\nlook at git-submodule or git-subtree.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"149550","messageId":"m339ttoiqh.fsf@localhost.localdomain","threadId":"24931","inReplyTo":"i5kudr$dp7$1@dough.gmane.org","subject":"Re: Additional remote on a local clone. Where do the objects go?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-01T10:34:19Z","receivedAt":"2010-09-01T10:34:19Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Stephen Kelly <steveire@gmail.com> writes:\n\n> The aim is to have multiple local checkouts of different branches of Qt \n> while sharing the same object store. [...]\n\nWhy not use git-new-workdir shell script from contrib/worktree/ in\ngit sources[1]?\n\n[1] http://repo.or.cz/w/git.git/blob_plain/HEAD:/contrib/workdir/git-new-workdir\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"149553","messageId":"i5len7$dpr$1@dough.gmane.org","threadId":"24931","inReplyTo":"AANLkTi=_uP_zFOV_k=cM8TXH16kTPAoPGpNkz+QUSzb-@mail.gmail.com","subject":"Re: Additional remote on a local clone. Where do the objects go?","fromName":"Stephen Kelly","fromEmail":"steveire@gmail.com","sentAt":"2010-09-01T11:51:03Z","receivedAt":"2010-09-01T11:51:03Z","isPatch":false,"sender":{"key":"steveire@gmail.com","avatar":null},"body":"Tay Ray Chuan wrote:\n\n> Hi,\n> \n> On Wed, Sep 1, 2010 at 3:12 PM, Stephen Kelly <steveire@gmail.com> wrote:\n>> git clone git://gitorious.org/qt/qt.git qtrepo\n>> cd qtrepo\n>> git checkout -b 4.7 origin/4.7\n>> git checkout -b 4.6 origin/4.6\n>> git clone qtrepo qt46\n>> cd qt46 && git checkout -b 4.6 origin/4.6\n>> cd ..\n>> git clone qtrepo qt47\n>> cd qt46 && git checkout -b 4.7 origin/4.7\n>> cd ..\n> \n> Two improvements: shared objects, and configuring git-pull:\n\nI'm confused. I thought the local clone already used shared objects?\n\n> \n>   git clone git://gitorious.org/qt/qt.git qtrepo\n>   git init qt46\n>   PARENT_GIT=$(pwd)/qtrepo/.git\n>   cd qt46\n> \n>   # use of shared objects - tell git where to find the \"missing\" objects\n>   cat $PARENT_GIT/objects > .git/objects/info/alternates\n> \n>   # setup of git pull\n>   cat <<EOF >> .git/config\n> [remote \"parent\"]\n>   url = $PARENT_GIT\n> [branch \"master\"]\n>   remote = parent\n>   merge = refs/remotes/origin/4.6\n> EOF\n\nSo this will pull from the gitorious remote and store the objects in the \nparent git from where they are shared with this local clone?\n\nWhich is the better solution between this and git-new-workdir given that \nthese are permanent branches, not temporary, and I'll want to push and pull \nvarious clones and share the objects. It looks like the git-new-workdir \noption creates symlinks, whereas the local clone creates hard links, and \nthis solution creates a redirect of sorts. \n\n> \n>   # done!\n>   git pull\n> \n> Repeat for 4.7.\n> \n> If you want to go one step further and track these repos, you could\n> look at git-submodule or git-subtree.\n> \n"},{"id":"149841","messageId":"AANLkTik=qeoq67KZa8Bj7Ynrt8O8ija6yeH6_+e4=gOZ@mail.gmail.com","threadId":"24931","inReplyTo":"i5len7$dpr$1@dough.gmane.org","subject":"Re: Additional remote on a local clone. Where do the objects go?","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-09-04T14:15:45Z","receivedAt":"2010-09-04T14:15:45Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\n(Please avoid dropping emails from the Cc list. Since you're using\ngmail, you could use \"Reply to all\".)\n\nOn Wed, Sep 1, 2010 at 7:51 PM, Stephen Kelly <steveire@gmail.com> wrote:\n> Tay Ray Chuan wrote:\n>> Two improvements: shared objects, and configuring git-pull:\n>\n> I'm confused. I thought the local clone already used shared objects?\n\nYou'd have to use \"-s/--shared\" with git clone; I don't think it's\ndone by default.\n\n(On hindsight, I should have used this instead of setting it up\nmanually by writing to .git/objects/info/alternates.)\n\n> So this will pull from the gitorious remote and store the objects in the\n> parent git from where they are shared with this local clone?\n\nNo, you'd have to first pull from gitorious in your parent directory,\nbefore going into the local repo/branch (eg. qt46) and then pulling\nagain.\n\n> Which is the better solution between this and git-new-workdir given that\n> these are permanent branches, not temporary, and I'll want to push and pull\n> various clones and share the objects. It looks like the git-new-workdir\n> option creates symlinks, whereas the local clone creates hard links, and\n> this solution creates a redirect of sorts.\n\nI haven't used git-new-workdir comprehensively, so I'll avoid\ncommenting too much, but I'd like to know if you've looked at\nbranches? You can just switch between each and do your qt 4.6- and\n4.7-specific work.\n\nI say that, because what you're doing sounds like what a hg user would\ndo to emulate git branches.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"150011","messageId":"i61ad4$jq2$1@dough.gmane.org","threadId":"24931","inReplyTo":"AANLkTik=qeoq67KZa8Bj7Ynrt8O8ija6yeH6_+e4=gOZ@mail.gmail.com","subject":"Re: Additional remote on a local clone. Where do the objects go?","fromName":"Stephen Kelly","fromEmail":"steveire@gmail.com","sentAt":"2010-09-05T23:50:59Z","receivedAt":"2010-09-05T23:50:59Z","isPatch":false,"sender":{"key":"steveire@gmail.com","avatar":null},"body":"Tay Ray Chuan wrote:\n\n> Hi,\n> \n> (Please avoid dropping emails from the Cc list. Since you're using\n> gmail, you could use \"Reply to all\".)\n\nActually I'm posting using GMane through KNode. I'll keep you in the CC but \nthere's no need to CC me.\n\n> \n> On Wed, Sep 1, 2010 at 7:51 PM, Stephen Kelly <steveire@gmail.com> wrote:\n>> Tay Ray Chuan wrote:\n>>> Two improvements: shared objects, and configuring git-pull:\n>>\n>> I'm confused. I thought the local clone already used shared objects?\n> \n> You'd have to use \"-s/--shared\" with git clone; I don't think it's\n> done by default.\n\nIndeed, --local is default, which sets up hard links, so they are shared in \nthat sense. So it looks like the suggestion is I should remove the --local \nclones and start again with --shared so that the objects directory is \nsymlinked? Is that better than hard links?\n\n> \n> (On hindsight, I should have used this instead of setting it up\n> manually by writing to .git/objects/info/alternates.)\n> \n>> So this will pull from the gitorious remote and store the objects in the\n>> parent git from where they are shared with this local clone?\n> \n> No, you'd have to first pull from gitorious in your parent directory,\n> before going into the local repo/branch (eg. qt46) and then pulling\n> again.\n\nRight. That's what I do currently, but it's not optimally convenient. I'd \nlike to just go to the qt46 clone, set it up with the correct remote url and \npull there, with the result being that the objects I pull are still shared \nacross all the local clones.\n\n> \n>> Which is the better solution between this and git-new-workdir given that\n>> these are permanent branches, not temporary, and I'll want to push and\n>> pull various clones and share the objects. It looks like the\n>> git-new-workdir option creates symlinks, whereas the local clone creates\n>> hard links, and this solution creates a redirect of sorts.\n> \n> I haven't used git-new-workdir comprehensively, so I'll avoid\n> commenting too much, but I'd like to know if you've looked at\n> branches? You can just switch between each and do your qt 4.6- and\n> 4.7-specific work.\n\nSwitching between branches costs time and I often need to work with more \nthan one at a time, and I need separate build directories for them, so I'm \ntrying to get these 'permanent checked-out branch directories' set up \nconveniently.\n\n> \n> I say that, because what you're doing sounds like what a hg user would\n> do to emulate git branches.\n> \n\nI only used hg for the first time on Friday to clone a repo. Not sure what \nthe workflow with that SCM is.\n\nThanks for the pointers,\n\nSteve.\n"}]}