Re: [PATCH v3 05/10] upload-pack, receive-pack: introduce protocol version 1
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Oct 10, 2017, 18:28 UTC
- Message-ID
- <20171010112818.bd75e8dbe4ae39c90e6512da@google.com>
- In-Reply-To
- <20171003201507.3589-6-bmwill@google.com>
On Tue, 3 Oct 2017 13:15:02 -0700 Brandon Williams <bmwill@google.com> wrote:
Show 8 quoted lines
> + 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.
> + */Peff sent out at least one patch [1] that reformats fallthrough comments to be understood by GCC. It's probably worth doing here too.
In this case, I would do the 2-comment system that Peff suggested:
/* * v1 is just the original protocol with a version string, * so just fall through after writing the version string. */ if (advertise_refs || !stateless_rpc) packet_write_fmt(1, "version 1\n"); /* fallthrough */
(I put the first comment before the code, so it doesn't look so weird.)
[1] https://public-inbox.org/git/20170921062541.ew67gyvrmb2ot4sf@sigill.intra.peff.net/
Show 5 quoted lines
> + case protocol_v0:
> + break;
> + default:
> + BUG("unknown protocol version");
> + }