{"thread":{"id":"25190","subject":"Enforcing clone/fetch to use references.","startedAt":"2010-09-21T20:44:56Z","lastAt":"2010-09-23T12:39:19Z","messageCount":4,"participants":["David Brown","Jeff King","Arun Raghavan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"151249","messageId":"20100921204456.GA24357@huya.qualcomm.com","threadId":"25190","inReplyTo":null,"subject":"Enforcing clone/fetch to use references.","fromName":"David Brown","fromEmail":"davidb@codeaurora.org","sentAt":"2010-09-21T20:44:56Z","receivedAt":"2010-09-21T20:44:56Z","isPatch":false,"sender":{"key":"davidb@codeaurora.org","avatar":"https://gravatar.com/avatar/1bacedec21621bd4efa4bc8ecb05c507f0cf0641ecdaa50943c2ed21c8ef22d8?d=mp&s=160"},"body":"[resending with corrected subject]\n\nSuppose I want to publish some changes to a tree.  I have a server\navailable where I can run a git daemon, but for one reason or another\nI want to force people to use the another git repo as a reference.\nThe reason could be one of bandwidth, or someone who isn't comfortable\nmaking all of the other source available.  Ideally, someone who\nalready has the other git repo cloned, and just adds mine as a remote\nwouldn't notice the difference.\n\nIs there a way to do this?  I've tried various ways of using\nalternates to keep the blobs out of the repository I want to export,\nbut the daemon just follows the alternates.  If I remove the\nalternates, I then seem to have a broken repository.  Most things I\ntry, at least carry objects for all of the files in the HEAD tree,\nwhich most of the time is a large portion of the data.\n\nIf there isn't a way of doing this currently, is this something that\nothers would find useful?\n\nThanks,\nDavid\n\n-- \nSent by an employee of the Qualcomm Innovation Center, Inc.\nThe Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.\n"},{"id":"151255","messageId":"20100921213135.GB1255@sigill.intra.peff.net","threadId":"25190","inReplyTo":"20100921204456.GA24357@huya.qualcomm.com","subject":"Re: Enforcing clone/fetch to use references.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-09-21T21:31:35Z","receivedAt":"2010-09-21T21:31:35Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 21, 2010 at 01:44:56PM -0700, David Brown wrote:\n\n> Suppose I want to publish some changes to a tree.  I have a server\n> available where I can run a git daemon, but for one reason or another\n> I want to force people to use the another git repo as a reference.\n> The reason could be one of bandwidth, or someone who isn't comfortable\n> making all of the other source available.  Ideally, someone who\n> already has the other git repo cloned, and just adds mine as a remote\n> wouldn't notice the difference.\n\nI think the gentoo people were talking about doing something like this.\nThey wanted you to use some faster and/or restartable protocol to clone\ninitially, and so they wanted to reject initial clones. I'm not sure if\nthey are doing that, and how (from the thread below, I suspect they run\na patched git).\n\nThe simplest thing would be a pre-upload-pack hook. There was some\ndiscussion of that in this thread:\n\n  http://article.gmane.org/gmane.comp.version-control.git/137007\n\nbut there are some security implications. For a remote site, where the\nuser running upload-pack trusts the hook, it should be fine.\n\nOnce you have that hook, then you basically need to just check whether\nthey are requesting objects in your \"you should have this in your\nreference repository\" set (probably by using merge-base to see if it is\ncontained in some \"everything our alternate has\" ref), and then just\n\n  echo >&2 Sorry, here's how to clone properly...\n  exit 1\n\nwhich should go to the user over the sideband.\n\nAnd that would cover both the \"clone --reference\" and \"git remote add\"\ncases, as it is not looking at what the user invoked, but which objects\nthey're requesting.\n\n-Peff\n"},{"id":"151257","messageId":"20100921221229.GA29680@huya.qualcomm.com","threadId":"25190","inReplyTo":"20100921213135.GB1255@sigill.intra.peff.net","subject":"Re: Enforcing clone/fetch to use references.","fromName":"David Brown","fromEmail":"davidb@codeaurora.org","sentAt":"2010-09-21T22:12:29Z","receivedAt":"2010-09-21T22:12:29Z","isPatch":false,"sender":{"key":"davidb@codeaurora.org","avatar":"https://gravatar.com/avatar/1bacedec21621bd4efa4bc8ecb05c507f0cf0641ecdaa50943c2ed21c8ef22d8?d=mp&s=160"},"body":"On Tue, Sep 21, 2010 at 05:31:35PM -0400, Jeff King wrote:\n> On Tue, Sep 21, 2010 at 01:44:56PM -0700, David Brown wrote:\n> \n> > Suppose I want to publish some changes to a tree.  I have a server\n> > available where I can run a git daemon, but for one reason or another\n> > I want to force people to use the another git repo as a reference.\n> > The reason could be one of bandwidth, or someone who isn't comfortable\n> > making all of the other source available.  Ideally, someone who\n> > already has the other git repo cloned, and just adds mine as a remote\n> > wouldn't notice the difference.\n> \n> I think the gentoo people were talking about doing something like this.\n> They wanted you to use some faster and/or restartable protocol to clone\n> initially, and so they wanted to reject initial clones. I'm not sure if\n> they are doing that, and how (from the thread below, I suspect they run\n> a patched git).\n> \n> The simplest thing would be a pre-upload-pack hook. There was some\n> discussion of that in this thread:\n> \n>   http://article.gmane.org/gmane.comp.version-control.git/137007\n\nArun, did you ever get a chance to rework the upload-pack hooks to\nwork only from git daemon?  If not, I'd like to take a look into\nimplementing this.\n\nThanks,\nDavid\n\n-- \nSent by an employee of the Qualcomm Innovation Center, Inc.\nThe Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.\n"},{"id":"151356","messageId":"AANLkTik-VRdUzFSBD2VADp=WMVtRh_kO6zjZxLxOZohW@mail.gmail.com","threadId":"25190","inReplyTo":"20100921221229.GA29680@huya.qualcomm.com","subject":"Re: Enforcing clone/fetch to use references.","fromName":"Arun Raghavan","fromEmail":"ford_prefect@gentoo.org","sentAt":"2010-09-23T12:39:19Z","receivedAt":"2010-09-23T12:39:19Z","isPatch":false,"sender":{"key":"ford_prefect@gentoo.org","avatar":null},"body":"Hey David,\n\nOn 22 September 2010 03:42, David Brown <davidb@codeaurora.org> wrote:\n> On Tue, Sep 21, 2010 at 05:31:35PM -0400, Jeff King wrote:\n>> On Tue, Sep 21, 2010 at 01:44:56PM -0700, David Brown wrote:\n>>\n>> > Suppose I want to publish some changes to a tree.  I have a server\n>> > available where I can run a git daemon, but for one reason or another\n>> > I want to force people to use the another git repo as a reference.\n>> > The reason could be one of bandwidth, or someone who isn't comfortable\n>> > making all of the other source available.  Ideally, someone who\n>> > already has the other git repo cloned, and just adds mine as a remote\n>> > wouldn't notice the difference.\n>>\n>> I think the gentoo people were talking about doing something like this.\n>> They wanted you to use some faster and/or restartable protocol to clone\n>> initially, and so they wanted to reject initial clones. I'm not sure if\n>> they are doing that, and how (from the thread below, I suspect they run\n>> a patched git).\n>>\n>> The simplest thing would be a pre-upload-pack hook. There was some\n>> discussion of that in this thread:\n>>\n>>   http://article.gmane.org/gmane.comp.version-control.git/137007\n>\n> Arun, did you ever get a chance to rework the upload-pack hooks to\n> work only from git daemon?  If not, I'd like to take a look into\n> implementing this.\n\nI never did get a chance to finish work on this. The last IRC\ndiscussion we had about this is at\nhttp://dev.gentoo.org/~ford_prefect/git-hooks-discussion-log.txt\n\nWe still definitely do need this in Gentoo for when our git migration happens.\n\nCheers,\n-- \nArun Raghavan\nhttp://arunraghavan.net/\n(Ford_Prefect | Gentoo) & (arunsr | GNOME)\n"}]}