Re: [PATCH] fetch-pack: start multi-head pulling.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-08-13 02:12:57
On Fri, 12 Aug 2005, Junio C Hamano wrote:
>
> Linus, I need a bit of guidance from you about this one; an
> ancient commit 4f7770c87ce3c302e1639a7737a6d2531fe4b160 removed
> the multi-head support fetch-pack once had, labelling it as "a
> misguided attempt", and I would like to know if I am making the
> same misguided attempt again.  This update actually makes
> clone-pack almost redundant.

I like your version.

My misguided attempt was not the ability to pull multiple heads, but what 
to _do_ with them. I originally envisioned something more "git-push-pack" 
like, where it would pull multiple heads into real references, and _that_ 
was the misguided part. I then ended up just printing it out to stdout, 
and that made it "one ref only".

Your version where you just print out multiple heads with names is, I 
think, the right thing to do.

The shell script looks a bit unreadable to me, personally.

>  	head=$(git-fetch-pack "$merge_repo" "$merge_head")
> +	if h=`expr "$head" : '\([^ ][^ ]*\) '`
> +	then
> +	    head=$h
> +	fi

Back-ticks, and the ":" operator to "expr". You really _are_ old-fashioned 
when it comes to shell ;)

Wouldn't it be simpler/cleaner to just do

	head=($(git-fetch-pack "$merge_repo" "$merge_head"))

which gets you "$head" being the same as ${head[0]}, namely the SHA1 you 
want (and if you ever implement multi-head pulling, you'll have it all in 
${head[..]}..)

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Aug 13 02:16:33 2005

This archive was generated by hypermail 2.1.8 : 2005-08-13 02:16:35 EST