git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* remote-helpers and refs without a value
@ 2011-03-27  8:24 Mike Hommey
  2011-03-28  7:22 ` Tay Ray Chuan
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Hommey @ 2011-03-27  8:24 UTC (permalink / raw
  To: git

Hi,

If I understand correctly how remote helpers work, the values that the
helper returns to the list command is then used to update the remote
branches, or FETCH_HEAD, dependint how the fetch happened.

But when the helper returns a '?' value to the list command, I don't see
how things are supposed to be updated. It looks like the helper is
the only one, then, to be able to update the refs. But it also doesn't
have any way to know which refs it needs to update...

Is it a misunderstanding from my part, or is it something that should be
improved in the remote-helpers support?

Mike

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: remote-helpers and refs without a value
  2011-03-27  8:24 remote-helpers and refs without a value Mike Hommey
@ 2011-03-28  7:22 ` Tay Ray Chuan
  2011-03-28  7:50   ` Mike Hommey
  0 siblings, 1 reply; 5+ messages in thread
From: Tay Ray Chuan @ 2011-03-28  7:22 UTC (permalink / raw
  To: Mike Hommey; +Cc: git

Hi,

On Sun, Mar 27, 2011 at 4:24 PM, Mike Hommey <mh@glandium.org> wrote:
> But when the helper returns a '?' value to the list command, I don't see
> how things are supposed to be updated. It looks like the helper is
> the only one, then, to be able to update the refs. But it also doesn't
> have any way to know which refs it needs to update...

I don't think that's right. The transport machinery (transport.c,
transport-helper.c) in git is the one who calls the shots - the
transport machinery first 1) asks for the list of refs, 2) does the
appropriate "matching" (of what refs to fetch/push), then 3) sends
this down to the remote helper.

If the remote helper sends back a '?', the transport machinery should
be implemented to fail and die. A quick scan of transport.c does not
show this, but I assume the failure would happen at the ref matching
level, leading to failure of the whole fetch/push.

-- 
Cheers,
Ray Chuan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: remote-helpers and refs without a value
  2011-03-28  7:22 ` Tay Ray Chuan
@ 2011-03-28  7:50   ` Mike Hommey
  2011-03-30  1:59     ` Tay Ray Chuan
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Hommey @ 2011-03-28  7:50 UTC (permalink / raw
  To: Tay Ray Chuan; +Cc: git

On Mon, Mar 28, 2011 at 03:22:57PM +0800, Tay Ray Chuan wrote:
> Hi,
> 
> On Sun, Mar 27, 2011 at 4:24 PM, Mike Hommey <mh@glandium.org> wrote:
> > But when the helper returns a '?' value to the list command, I don't see
> > how things are supposed to be updated. It looks like the helper is
> > the only one, then, to be able to update the refs. But it also doesn't
> > have any way to know which refs it needs to update...
> 
> I don't think that's right. The transport machinery (transport.c,
> transport-helper.c) in git is the one who calls the shots - the
> transport machinery first 1) asks for the list of refs, 2) does the
> appropriate "matching" (of what refs to fetch/push), then 3) sends
> this down to the remote helper.
> 
> If the remote helper sends back a '?', the transport machinery should
> be implemented to fail and die. A quick scan of transport.c does not
> show this, but I assume the failure would happen at the ref matching
> level, leading to failure of the whole fetch/push.

Failing wouldn't make sense. That'd mean '?' may not be used by
remote-helpers, and that they'd need to grab everything from the remote
before git even decides what to grab.

Mike

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: remote-helpers and refs without a value
  2011-03-28  7:50   ` Mike Hommey
@ 2011-03-30  1:59     ` Tay Ray Chuan
  2011-03-30  6:25       ` Mike Hommey
  0 siblings, 1 reply; 5+ messages in thread
From: Tay Ray Chuan @ 2011-03-30  1:59 UTC (permalink / raw
  To: Mike Hommey; +Cc: git

On Mon, Mar 28, 2011 at 3:50 PM, Mike Hommey <mh@glandium.org> wrote:
> Failing wouldn't make sense. That'd mean '?' may not be used by
> remote-helpers, and that they'd need to grab everything from the remote
> before git even decides what to grab.

I guess from "grab" you mean fetching the actual objects etc. However,
I believe the '?' is used only in the ref fetching/matching step,
which is before the step where the actual objects are fetched.

So, if a '?' was reported by the helper, then the transport machinery
would most likely be unable to properly match refs; then, it would not
direct the remote-helpers to fetch anything (ie. objects).

-- 
Cheers,
Ray Chuan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: remote-helpers and refs without a value
  2011-03-30  1:59     ` Tay Ray Chuan
@ 2011-03-30  6:25       ` Mike Hommey
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Hommey @ 2011-03-30  6:25 UTC (permalink / raw
  To: Tay Ray Chuan; +Cc: git

On Wed, Mar 30, 2011 at 09:59:42AM +0800, Tay Ray Chuan wrote:
> On Mon, Mar 28, 2011 at 3:50 PM, Mike Hommey <mh@glandium.org> wrote:
> > Failing wouldn't make sense. That'd mean '?' may not be used by
> > remote-helpers, and that they'd need to grab everything from the remote
> > before git even decides what to grab.
> 
> I guess from "grab" you mean fetching the actual objects etc. However,
> I believe the '?' is used only in the ref fetching/matching step,
> which is before the step where the actual objects are fetched.
> 
> So, if a '?' was reported by the helper, then the transport machinery
> would most likely be unable to properly match refs; then, it would not
> direct the remote-helpers to fetch anything (ie. objects).

Which means the helper is doomed not to report '?', and for that, it
needs to fetch from the remote. Which makes the fetch method pretty
useless for non git remotes, while it has some advantages over import
method.

Mike

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-30  6:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-27  8:24 remote-helpers and refs without a value Mike Hommey
2011-03-28  7:22 ` Tay Ray Chuan
2011-03-28  7:50   ` Mike Hommey
2011-03-30  1:59     ` Tay Ray Chuan
2011-03-30  6:25       ` Mike Hommey

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).