Re: [PATCH] protocol: treat unrecognized protocol.version setting as 0
- From
- Brandon Williams <bmwill@google.com>
- Date
- Feb 28, 2018, 01:16 UTC
- Message-ID
- <20180228011604.GC45342@google.com>
- In-Reply-To
- <CACsJy8Cn2hcodoR8ksRBY9qf7MmJaP+KAzYqv6seeR9s-Be8Hw@mail.gmail.com>
On 02/28, Duy Nguyen wrote:
Show 27 quoted lines
> On Wed, Feb 28, 2018 at 8:02 AM, Brandon Williams <bmwill@google.com> wrote: > > On 02/27, Jonathan Nieder wrote: > >> If I share my .gitconfig or .git/config file between multiple machines > >> (or between multiple Git versions on a single machine) and set > >> > >> [protocol] > >> version = 2 > >> > >> then running "git fetch" with a Git version that does not support > >> protocol v2 errors out with > >> > >> fatal: unknown value for config 'protocol.version': 2 > >> > >> In the spirit of v1.7.6-rc0~77^2~1 (Improve error handling when > >> parsing dirstat parameters, 2011-04-29), it is better to (perhaps > >> after warning the user) ignore the unrecognized protocol version. > >> After all, future Git versions might add even more protocol versions, > >> and using two different Git versions with the same Git repo, machine, > >> or home directory should not cripple the older Git version just > >> because of a parameter that is only understood by a more recent Git > >> version. > > I wonder if it's better to specify multiple versions. If v2 is not > recognized by this git but v0 is, then it can pick that up. But if you > explicitly tell it to choose between v2 and v3 only and it does not > understand either, then it dies. Not sure if this is a good idea > though.
I mean that's definitely a possibility, but I don't think its worth the effort to get that working until we actually need it. I'm hoping we really don't bump version numbers often.
-- Brandon Williams