Subject: Re: [PATCH v2 5/9] upload-pack, receive-pack: introduce protocol version 1

From: Brandon Williams <[email-masked]>
Date: Wed, 27 Sep 2017 14:29:48 -0700

On 09/27, Junio C Hamano wrote:
> Brandon Williams <[email-masked]> writes:
> 
> > @@ -1963,6 +1964,19 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
> >  	else if (0 <= receive_unpack_limit)
> >  		unpack_limit = receive_unpack_limit;
> >  
> > +	switch (determine_protocol_version_server()) {
> > +	case protocol_v1:
> > +		if (advertise_refs || !stateless_rpc)
> > +			packet_write_fmt(1, "version 1\n");
> > +		/*
> > +		 * v1 is just the original protocol with a version string,
> > +		 * so just fall through after writing the version string.
> > +		 */
> > +	case protocol_v0:
> > +	default:
> > +		break;
> 
> When protocol_v2 is introduced in the other part of the codebase
> (i.e. in protocol.[ch]), until these lines are updated accordingly
> to take care of the new protocol, we'd pretend that client asked
> (and the server accepted) v0, even though the client and the daemon
> agreed to talk v2.
> 
> Shouldn't the "default:" die instead?  The same for upload-pack.c

Good catch.  Yeah you're right, the default should probably die saying
that receive pack or upload pack doesn't support the protocol version.

-- 
Brandon Williams