From: Jonathan Nieder <jrnieder@gmail.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, newren@gmail.com, delphij@google.com,
peff@peff.net, Derrick Stolee <derrickstolee@github.com>,
Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH] setup: tweak upgrade policy to grandfather worktreeconfig
Date: Mon, 13 Jul 2020 21:06:16 -0700 [thread overview]
Message-ID: <20200714040616.GA2208896@google.com> (raw)
In-Reply-To: <b8ae18f7-a0af-bd62-2553-92989e1dbe7e@gmail.com>
Hi,
Derrick Stolee wrote:
> On 7/13/2020 4:18 PM, Junio C Hamano wrote:
>> The "fail and warn" approach introduced in the previous step may be
>> with smaller impact to the codebase, but
>>
>> - it requires the end-user to read, understand and execute the
>> manual upgrade
>>
>> - it encourages to follow the same procedure blindly, making the
>> protection even less useful
>>
>> Let's instead keep failing hard without teaching how to bypass the
>> repository protection, but allow upgrading even when only the
>> worktreeconfig extension exists in an old repository, which is
>> likely to be set by a broke version of Git that did not update the
>> repository version when setting the extension.
>
> This is a more subtle way to handle the case. In fact, it
> silently makes extensions.worktreeConfig work as it did in 2.27,
> which means users will not have any troubles after upgrading.
I'd like to propose a different endgame:
Instead of looking at `extensions.*` settings one by one to see how
various implementations handled them with repositoryFormatVersion=0,
what if we treat repositoryFormatVersion=0 as a synonym of version=1?
That is:
1. in new repositories, set repositoryFormatVersion = 1, since (1) Git
versions in the wild should all already know how to handle it and
(2) as we've learned, other Git implementations need to understand
some of extensions.* anyway
2. whenever setting any extensions.*, automatically upgrade to
repositoryFormatVersion = 1
3. when in an existing repository with extensions.* set and
repositoryFormatVersion = 0, act as though repositoryFormatVersion = 1
4. document this new behavior with repositoryFormatVersion = 0 in
Documentation/technical/repository-version.txt
This way, the result is simpler than where we started.
Unfortunately, we are not even that consistent about what to do with
extensions.* settings when repositoryFormatVersion = 0 today. So
we'll have to exercise some care and analyze them one by one to make
sure this is safe (and if it isn't, at *that* point we'd come up with
a more complex variant on (2) and (3) above).
It's too late to go that far for 2.28. It would be tempting to try a
simple revert of 14c7fa269e4 (check_repository_format_gently(): refuse
extensions for old repositories, 2020-06-05) to get back to tried and
true behavior but that does not do enough --- it still produces an
error when trying to upgrade repository format when any extensions are
set. So how about such a revert plus Junio's patch plus the analogous
change to Junio's patch for
extensions.preciousObjects
extensions.partialClone
?
Thanks,
Jonathan
next prev parent reply other threads:[~2020-07-14 4:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-13 19:20 [PATCH] setup: warn if extensions exist on old format Derrick Stolee via GitGitGadget
2020-07-13 19:34 ` Taylor Blau
2020-07-13 19:41 ` Derrick Stolee
2020-07-13 19:36 ` Junio C Hamano
2020-07-13 20:00 ` Junio C Hamano
2020-07-13 20:18 ` [PATCH] setup: tweak upgrade policy to grandfather worktreeconfig Junio C Hamano
2020-07-13 20:46 ` Derrick Stolee
2020-07-13 21:45 ` Junio C Hamano
2020-07-14 4:06 ` Jonathan Nieder [this message]
2020-07-14 4:27 ` Junio C Hamano
2020-07-14 1:26 ` [PATCH v2 0/2] setup: warn if extensions exist on old format Derrick Stolee via GitGitGadget
2020-07-14 1:26 ` [PATCH v2 1/2] setup: tweak upgrade policy to grandfather worktreeconfig Derrick Stolee via GitGitGadget
2020-07-14 20:22 ` Johannes Schindelin
2020-07-14 1:26 ` [PATCH v2 2/2] config: provide extra detail about worktree config Derrick Stolee via GitGitGadget
2020-07-14 20:24 ` [PATCH v2 0/2] setup: warn if extensions exist on old format Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200714040616.GA2208896@google.com \
--to=jrnieder@gmail.com \
--cc=delphij@google.com \
--cc=derrickstolee@github.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).