On Mon, Oct 10, 2005 at 02:00:06AM -0700, Junio C Hamano wrote:
The fetch_alternates() function was supposed to be call-once and
we have a static variable got_alternates that becomes 1 when it
runs for the first time. However, there are other 'return 0's
introduced that does not set got_alternates to 1.
Oops, thanks for catching that - I'll fix it.
I am wondering if the semantics has changed that now we chain
the alternates? Initially, if we are cloning/fetching from
repository A, which borrows from repository B (i.e. alternates
we retrieve from A would name B), and if B in turn borrows from
C, then we assumed that A's alternates would also name C, and
that was the reason why fetch_alternates() was call-once
function. I do not mind if we change it to chain the alternates
file, but if that is the case we should move the got_alternates
variable into "struct alt_base", and pass the struct, not just
alt->base, to fetch_alternates(), like this (untested, of
course):
I'd thought about chaining the alternates, but wasn't sure whether it's
safe to consider all alternates in the chain equivalent. I would want to
implement fetching the chain such that it could happen parallel to other
request and not block the pull. I think it would also be useful to track
the network performance of each alternate and prefer faster sources as
new requests are started.
--
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.