Re: Protocol v2 in v2.27 (Re: Re* [ANNOUNCE] Git v2.27.0-rc1)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 20, 2020, 23:59 UTC
- Message-ID
- <xmqqlflmtaxq.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200520220023.GB3648@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> Speaking of which, should we enable protocol v2 by default for people > with feature.experimental enabled, like this?
It is an excellent idea, but is something that had to have been proposed before -rc0 to be in the upcoming release, no?
The patch looks good; do we have the master list of things that are under control of feature.experimental knob in the documentation, or is it a feature that we do not have to have a centralized control?
Show 36 quoted lines
> diff --git c/Documentation/config/protocol.txt i/Documentation/config/protocol.txt
> index 0b40141613e..c46e9b3d00a 100644
> --- c/Documentation/config/protocol.txt
> +++ i/Documentation/config/protocol.txt
> @@ -48,7 +48,8 @@ protocol.version::
> If set, clients will attempt to communicate with a server
> using the specified protocol version. If the server does
> not support it, communication falls back to version 0.
> - If unset, the default is `0`.
> + If unset, the default is `0`, unless `feature.experimental`
> + is enabled, in which case the default is `2`.
> Supported versions:
> +
> --
> diff --git c/protocol.c i/protocol.c
> index d390391ebac..d1dd3424bba 100644
> --- c/protocol.c
> +++ i/protocol.c
> @@ -17,6 +17,7 @@ static enum protocol_version parse_protocol_version(const char *value)
> enum protocol_version get_protocol_version_config(void)
> {
> const char *value;
> + int val;
> const char *git_test_k = "GIT_TEST_PROTOCOL_VERSION";
> const char *git_test_v;
>
> @@ -30,6 +31,9 @@ enum protocol_version get_protocol_version_config(void)
> return version;
> }
>
> + if (!git_config_get_bool("feature.experimental", &val) && val)
> + return protocol_v2;
> +
> git_test_v = getenv(git_test_k);
> if (git_test_v && *git_test_v) {
> enum protocol_version env = parse_protocol_version(git_test_v);