On Mon, Oct 16, 2017 at 10:55:24AM -0700, Brandon Williams wrote:
> Create protocol.{c,h} and provide functions which future servers and
> clients can use to determine which protocol to use or is being used.
>
> Also introduce the 'GIT_PROTOCOL' environment variable which will be
> used to communicate a colon separated list of keys with optional values
> to a server. Unknown keys and values must be tolerated. This mechanism
> is used to communicate which version of the wire protocol a client would
> like to use with a server.
>
> Signed-off-by: Brandon Williams <[email protected]>
> ---
> Documentation/config.txt | 17 +++++++++++
> Documentation/git.txt | 6 ++++
> Makefile | 1 +
> cache.h | 8 +++++
> protocol.c | 79
> ++++++++++++++++++++++++++++++++++++++++++++++++
> protocol.h | 33 ++++++++++++++++++++
> 6 files changed, 144 insertions(+)
> create mode 100644 protocol.c
> create mode 100644 protocol.h
>
> [...]
>
> diff --git a/protocol.h b/protocol.h
> new file mode 100644
> index 000000000..1b2bc94a8
> --- /dev/null
> +++ b/protocol.h
> @@ -0,0 +1,33 @@
> +#ifndef PROTOCOL_H
> +#define PROTOCOL_H
> +
> +enum protocol_version {
> + protocol_unknown_version = -1,
> + protocol_v0 = 0,
> + protocol_v1 = 1,
> +};
> +
> +/*
> + * Used by a client to determine which protocol version to request be used
> when
> + * communicating with a server, reflecting the configured value of the
> + * 'protocol.version' config. If unconfigured, a value of 'protocol_v0' is
> + * returned.
> + */
The first sentence reads a little weird to me around 'which version to
request be used'.