Re: [PATCH v2 5/9] upload-pack, receive-pack: introduce protocol version 1
- From
- Brandon Williams <bmwill@google.com>
- Date
- Sep 27, 2017, 21:29 UTC
- Message-ID
- <20170927212948.GB68699@google.com>
- In-Reply-To
- <xmqqvak467fy.fsf@gitster.mtv.corp.google.com>
On 09/27, Junio C Hamano wrote:
Show 25 quoted lines
> Brandon Williams <bmwill@google.com> 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.cGood 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