{"thread":{"id":"26878","subject":"remote-helpers and refs without a value","startedAt":"2011-03-27T08:24:28Z","lastAt":"2011-03-30T06:25:04Z","messageCount":5,"participants":["Mike Hommey","Tay Ray Chuan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"164386","messageId":"20110327082428.GA4428@glandium.org","threadId":"26878","inReplyTo":null,"subject":"remote-helpers and refs without a value","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2011-03-27T08:24:28Z","receivedAt":"2011-03-27T08:24:28Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"Hi,\n\nIf I understand correctly how remote helpers work, the values that the\nhelper returns to the list command is then used to update the remote\nbranches, or FETCH_HEAD, dependint how the fetch happened.\n\nBut when the helper returns a '?' value to the list command, I don't see\nhow things are supposed to be updated. It looks like the helper is\nthe only one, then, to be able to update the refs. But it also doesn't\nhave any way to know which refs it needs to update...\n\nIs it a misunderstanding from my part, or is it something that should be\nimproved in the remote-helpers support?\n\nMike\n"},{"id":"164408","messageId":"AANLkTi=cNin=XYqbAJMggWj7OcZ8=9PGCVGGg=JRO-bj@mail.gmail.com","threadId":"26878","inReplyTo":"20110327082428.GA4428@glandium.org","subject":"Re: remote-helpers and refs without a value","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2011-03-28T07:22:57Z","receivedAt":"2011-03-28T07:22:57Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sun, Mar 27, 2011 at 4:24 PM, Mike Hommey <mh@glandium.org> wrote:\n> But when the helper returns a '?' value to the list command, I don't see\n> how things are supposed to be updated. It looks like the helper is\n> the only one, then, to be able to update the refs. But it also doesn't\n> have any way to know which refs it needs to update...\n\nI don't think that's right. The transport machinery (transport.c,\ntransport-helper.c) in git is the one who calls the shots - the\ntransport machinery first 1) asks for the list of refs, 2) does the\nappropriate \"matching\" (of what refs to fetch/push), then 3) sends\nthis down to the remote helper.\n\nIf the remote helper sends back a '?', the transport machinery should\nbe implemented to fail and die. A quick scan of transport.c does not\nshow this, but I assume the failure would happen at the ref matching\nlevel, leading to failure of the whole fetch/push.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"164414","messageId":"20110328075009.GA5115@glandium.org","threadId":"26878","inReplyTo":"AANLkTi=cNin=XYqbAJMggWj7OcZ8=9PGCVGGg=JRO-bj@mail.gmail.com","subject":"Re: remote-helpers and refs without a value","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2011-03-28T07:50:09Z","receivedAt":"2011-03-28T07:50:09Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Mon, Mar 28, 2011 at 03:22:57PM +0800, Tay Ray Chuan wrote:\n> Hi,\n> \n> On Sun, Mar 27, 2011 at 4:24 PM, Mike Hommey <mh@glandium.org> wrote:\n> > But when the helper returns a '?' value to the list command, I don't see\n> > how things are supposed to be updated. It looks like the helper is\n> > the only one, then, to be able to update the refs. But it also doesn't\n> > have any way to know which refs it needs to update...\n> \n> I don't think that's right. The transport machinery (transport.c,\n> transport-helper.c) in git is the one who calls the shots - the\n> transport machinery first 1) asks for the list of refs, 2) does the\n> appropriate \"matching\" (of what refs to fetch/push), then 3) sends\n> this down to the remote helper.\n> \n> If the remote helper sends back a '?', the transport machinery should\n> be implemented to fail and die. A quick scan of transport.c does not\n> show this, but I assume the failure would happen at the ref matching\n> level, leading to failure of the whole fetch/push.\n\nFailing wouldn't make sense. That'd mean '?' may not be used by\nremote-helpers, and that they'd need to grab everything from the remote\nbefore git even decides what to grab.\n\nMike\n"},{"id":"164651","messageId":"AANLkTikVPevgKGf2B881ox0zZ5xqBLd9hH1pQF2pW2Jx@mail.gmail.com","threadId":"26878","inReplyTo":"20110328075009.GA5115@glandium.org","subject":"Re: remote-helpers and refs without a value","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2011-03-30T01:59:42Z","receivedAt":"2011-03-30T01:59:42Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"On Mon, Mar 28, 2011 at 3:50 PM, Mike Hommey <mh@glandium.org> wrote:\n> Failing wouldn't make sense. That'd mean '?' may not be used by\n> remote-helpers, and that they'd need to grab everything from the remote\n> before git even decides what to grab.\n\nI guess from \"grab\" you mean fetching the actual objects etc. However,\nI believe the '?' is used only in the ref fetching/matching step,\nwhich is before the step where the actual objects are fetched.\n\nSo, if a '?' was reported by the helper, then the transport machinery\nwould most likely be unable to properly match refs; then, it would not\ndirect the remote-helpers to fetch anything (ie. objects).\n\n-- \nCheers,\nRay Chuan\n"},{"id":"164660","messageId":"20110330062504.GA3559@glandium.org","threadId":"26878","inReplyTo":"AANLkTikVPevgKGf2B881ox0zZ5xqBLd9hH1pQF2pW2Jx@mail.gmail.com","subject":"Re: remote-helpers and refs without a value","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2011-03-30T06:25:04Z","receivedAt":"2011-03-30T06:25:04Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Wed, Mar 30, 2011 at 09:59:42AM +0800, Tay Ray Chuan wrote:\n> On Mon, Mar 28, 2011 at 3:50 PM, Mike Hommey <mh@glandium.org> wrote:\n> > Failing wouldn't make sense. That'd mean '?' may not be used by\n> > remote-helpers, and that they'd need to grab everything from the remote\n> > before git even decides what to grab.\n> \n> I guess from \"grab\" you mean fetching the actual objects etc. However,\n> I believe the '?' is used only in the ref fetching/matching step,\n> which is before the step where the actual objects are fetched.\n> \n> So, if a '?' was reported by the helper, then the transport machinery\n> would most likely be unable to properly match refs; then, it would not\n> direct the remote-helpers to fetch anything (ie. objects).\n\nWhich means the helper is doomed not to report '?', and for that, it\nneeds to fetch from the remote. Which makes the fetch method pretty\nuseless for non git remotes, while it has some advantages over import\nmethod.\n\nMike\n"}]}