All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH v2 3/8] Support taking over transports
Date: Fri, 4 Dec 2009 10:27:53 -0800	[thread overview]
Message-ID: <20091204182753.GD1483@spearce.org> (raw)
In-Reply-To: <1259942168-24869-6-git-send-email-ilari.liusvaara@elisanet.fi>

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> wrote:
> Add support for taking over transports that turn out to be smart.

I really don't like this disown strategy and its magic ref return
value from fetch.
 
> @@ -1020,7 +1089,13 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs)
>  			heads[nr_heads++] = rm;
>  	}
>  
> +retry:
>  	rc = transport->fetch(transport, nr_heads, heads);
> +	if(rc == TRANSPORT_LAYER6_READY) {
> +		git_take_over_transport(transport);
> +		goto retry;
> +	}

Why can't you expose git_take_over_transport as a public function
and then the transport-helper.c code can instead do:

	... setup connect with helper ...
	transport_takeover(transport, child);
	return transport->fetch(....);

Would this make the code simpler?

-- 
Shawn.

  reply	other threads:[~2009-12-04 18:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 15:55 [RFC PATCH v2 0/8] Remote helpers smart transport extensions Ilari Liusvaara
2009-12-04 15:55 ` Ilari Liusvaara
2009-12-04 15:56 ` Ilari Liusvaara
2009-12-04 15:56 ` [RFC PATCH v2 1/8] Pass unknown protocols to external protocol handlers Ilari Liusvaara
2009-12-04 16:01   ` Sverre Rabbelier
2009-12-04 17:55   ` Shawn O. Pearce
2009-12-05 13:17     ` Ilari Liusvaara
2009-12-04 15:56 ` [RFC PATCH v2 2/8] Refactor git transport options parsing Ilari Liusvaara
2009-12-04 15:56 ` [RFC PATCH v2 3/8] Support taking over transports Ilari Liusvaara
2009-12-04 18:27   ` Shawn O. Pearce [this message]
2009-12-05 13:18     ` Ilari Liusvaara
2009-12-04 15:56 ` [RFC PATCH v2 4/8] Support remote helpers implementing smart transports Ilari Liusvaara
2009-12-04 18:37   ` Shawn O. Pearce
2009-12-05 13:16     ` Ilari Liusvaara
2009-12-04 15:56 ` [RFC PATCH v2 5/8] Support remote archive from external protocol helpers Ilari Liusvaara
2009-12-04 15:56 ` [RFC PATCH v2 6/8] Remove special casing of http, https and ftp Ilari Liusvaara
2009-12-04 16:05   ` Sverre Rabbelier
2009-12-04 15:56 ` [RFC PATCH v2 7/8] Add remote helper debug mode Ilari Liusvaara
2009-12-04 16:03   ` Sverre Rabbelier
2009-12-04 15:56 ` [RFC PATCH v2 8/8] Support mandatory capabilities Ilari Liusvaara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091204182753.GD1483@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=ilari.liusvaara@elisanet.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.