Re: [PATCH v3 32/39] setup: add support for reading extensions.objectformat
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2020, 04:15 UTC
- Message-ID
- <xmqq4kpy50k6.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200723023900.GA1758454@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 19 quoted lines
>> By declaring that the repository is invalid if its version is less >> than 1 and objectFormat extension defined, we prevent unwanted >> upgrading from happening by mistake. > > Yes, and more specifically: > > * If the repository is v0 and has an objectFormat set, we fail in newer > versions of Git (i.e., after this series). Older versions which do > not support the extension will see breakage (because unknown > extensions are not fatal in v0), but we hope by adding this check that > nobody will ever configure a repo this way, since it will be totally > nonfunctional in this state, regardless of version. > * If the repository is v1 and has an objectFormat set, we work with > newer Git and everything is great. Older Git versions fail hard here, > and the user gets a moderately helpful error message. > > v2 of the series just ignored the setting in v0, which would make it > equally broken in older and newer versions, but would provide a less > useful error message (probably about a corrupt index).
Peff's 'jk/reject-newer-extensions-in-v0' uses a bit refactored code to make it easier to add only-v1-and-later extensions while rejecting them, even if the code knows about them, in v0 repository. Even though the mechanism is a bit different, the spirit is quite the same as this step.
Please double check origin/seen:setup.c to see if I resolved textual conflicts in a sensible way.
Thanks.