git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Derrick Stolee <stolee@gmail.com>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] setup: warn about un-enabled extensions
Date: Tue, 14 Jul 2020 14:21:30 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2007141420300.52@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <0bede821-139a-d805-934a-142004abaa4c@gmail.com>

Hi Stolee,

On Mon, 13 Jul 2020, Derrick Stolee wrote:

> On 7/13/2020 5:55 PM, Johannes Schindelin via GitGitGadget wrote:
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > When any `extensions.*` setting is configured, we newly ignore it unless
> > `core.repositoryFormatVersion` is set to a positive value.
> >
> > This might be quite surprising, e.g. when calling `git config --worktree
> > [...]` elicits a warning that it requires
> > `extensions.worktreeConfig = true` when that setting _is_ configured
> > (but ignored because `core.repositoryFormatVersion` is unset).
> >
> > Let's warn about this situation specifically, especially because there
> > might be already setups out there that configured a sparse worktree
> > using Git v2.27.0 (which does set `extensions.worktreeConfig` but not
> > `core.repositoryFormatVersion`) and users might want to work in those
> > setups with Git v2.28.0, too.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >     Warn when extensions.* is ignored
> >
> >     I did actually run into this today. One of my pipelines is configured to
> >     clone a bare repository, then set up a sparse secondary worktree. This
> >     used to work, but all of a sudden, the git config --worktree
> >     core.sparseCheckout true call failed because I'm now using v2.28.0-rc0.
>
> I tried your situation with Junio's patch from earlier [1] [2].
>
> [1] https://lore.kernel.org/git/pull.674.git.1594668051847.gitgitgadget@gmail.com/
> [2] https://lore.kernel.org/git/xmqqpn8zmao1.fsf_-_@gitster.c.googlers.com/
>
> The issue here is that Junio's silent fix for sparse-checkout doesn't
> work here for "git config --worktree". However, I think that Johannes
> is making the same over-compensating warning message pattern as I was.
> That is, this warning happens for all extensions that are enabled when
> core.repositoryFormatVersion is less than 1.
>
> To attempt to summarize Junio's opinion, we should keep our situation
> isolated to this worktree config extension. Your patch does agree with
> the others in that we don't revert the behavior of failing to set the
> config, but I think in this instance we can specify the warning more
> carefully.

Okay.

> If you don't mind, I was already going to squash Junio's commit into
> mine (almost completely replacing mine) but I could add a small
> commit on top that provides the following improvement to the error
> message:

I don't mind at all. I'd just like to know that v2.28.0 avoids confusing
users in the same was as v2.28.0-rc0 confused me.

Thanks,
Dscho

>
> diff --git a/builtin/config.c b/builtin/config.c
> index 5e39f618854..b5de7982a93 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -678,8 +678,9 @@ int cmd_config(int argc, const char **argv, const char *prefix)
>                 else if (worktrees[0] && worktrees[1])
>                         die(_("--worktree cannot be used with multiple "
>                               "working trees unless the config\n"
> -                             "extension worktreeConfig is enabled. "
> -                             "Please read \"CONFIGURATION FILE\"\n"
> +                             "extension worktreeConfig is enabled "
> +                             "and core.repositoryFormatVersion is at least\n"
> +                             "1. Please read \"CONFIGURATION FILE\""
>                               "section in \"git help worktree\" for details"));
>                 else
>                         given_config_source.file = git_pathdup("config");
>
> Thanks,
> -Stolee
>
>

  reply	other threads:[~2020-07-14 12:21 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 21:55 [PATCH] setup: warn about un-enabled extensions Johannes Schindelin via GitGitGadget
2020-07-13 22:48 ` Junio C Hamano
2020-07-14  0:24 ` Derrick Stolee
2020-07-14 12:21   ` Johannes Schindelin [this message]
2020-07-14 15:27     ` Junio C Hamano
2020-07-14 15:40       ` Derrick Stolee
2020-07-14 20:30         ` Johannes Schindelin
2020-07-14 20:47           ` Junio C Hamano
2020-07-15 16:09       ` Junio C Hamano
2020-07-15 17:01         ` Junio C Hamano
2020-07-15 18:00           ` Derrick Stolee
2020-07-15 18:09             ` Junio C Hamano
2020-07-15 18:40               ` Derrick Stolee
2020-07-15 19:16                 ` Johannes Schindelin
2020-07-15 18:15             ` Junio C Hamano
2020-07-15 19:21               ` Johannes Schindelin
2020-07-15 18:20         ` Jonathan Nieder
2020-07-16  2:06           ` Junio C Hamano
2020-07-16  6:20         ` [PATCH 0/2] extensions.* fixes for 2.28 (Re: [PATCH] setup: warn about un-enabled extensions) Jonathan Nieder
2020-07-16  6:24           ` [PATCH 1/2] Revert "check_repository_format_gently(): refuse extensions for old repositories" Jonathan Nieder
2020-07-16 10:56             ` Jeff King
2020-07-16  6:28           ` [PATCH 2/2] repository: allow repository format upgrade with extensions Jonathan Nieder
2020-07-16  7:01             ` Junio C Hamano
2020-07-16 11:00               ` Jeff King
2020-07-16 12:25                 ` Jeff King
2020-07-16 12:53                   ` Derrick Stolee
2020-07-16 16:32                   ` Junio C Hamano
2020-07-16 16:53                     ` Jeff King
2020-07-16 20:27                     ` Junio C Hamano
2020-07-16 16:49                   ` Junio C Hamano
2020-07-16 16:56                     ` Jeff King
2020-07-16 16:10                 ` Junio C Hamano
2020-07-16 22:37                   ` Jonathan Nieder
2020-07-16 23:50                     ` Junio C Hamano
2020-07-17 15:27                       ` Jeff King
2020-07-17 17:07                         ` Junio C Hamano
2020-07-17 15:22                     ` Jeff King
2020-07-16  8:13           ` [PATCH 0/2] extensions.* fixes for 2.28 (Re: [PATCH] setup: warn about un-enabled extensions) Johannes Schindelin
2020-07-16 12:17             ` Derrick Stolee

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=nycvar.QRO.7.76.6.2007141420300.52@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --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).