git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Philip Oakley <philipoakley@iee.email>
Cc: Philip Oakley via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH 2/2] rebase: `preserve` is also a pull option, tell dying users
Date: Wed, 23 Feb 2022 11:27:32 +0100	[thread overview]
Message-ID: <220223.86mtih6fai.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <c5197f9d-11eb-5f91-ce33-c196069dc2d8@iee.email>


On Tue, Feb 22 2022, Philip Oakley wrote:

> Hi Ævar,
>
> On 22/02/2022 15:56, Philip Oakley wrote:
>> On 22/02/2022 15:34, Ævar Arnfjörð Bjarmason wrote:
>>> On Tue, Feb 22 2022, Philip Oakley via GitGitGadget wrote:
>>>
>>>> From: Philip Oakley <philipoakley@iee.email>
>>>>
>>>> The `--preserve-merges` option was removed by v2.35.0. However
>>>> users may not be aware that it is also a Pull option, and it is
>>>> still offered by major IDE vendors such as Visual Studio.
>>>>
>>>> Extend the `--preserve-merges` die message to direct users to
>>>> this option and it's locations.
>>>>
>>>> Signed-off-by: Philip Oakley <philipoakley@iee.email>
>>>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>>>> ---
>>>>  builtin/rebase.c | 5 ++++-
>>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/builtin/rebase.c b/builtin/rebase.c
>>>> index 07221d0ae41..97f704bb297 100644
>>>> --- a/builtin/rebase.c
>>>> +++ b/builtin/rebase.c
>>>> @@ -1205,7 +1205,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
>>>>  			     builtin_rebase_usage, 0);
>>>>  
>>>>  	if (preserve_merges_selected)
>>>> -		die(_("--preserve-merges was replaced by --rebase-merges"));
>>>> +		die(_("--preserve-merges was replaced by --rebase-merges\n"
>>>> +			"Also, check your `pull` configuration settings\n"
>>>> +			"`git config --show-scope --show-origin --get-regexp 'pull.*'`\n"
>>>> +			"which may also invoke this option."));
>>> I may be missing some subtlety, but how is the user ever going to need
>>> to check their config?
>>>
>>> After 52f1e82178e (pull: remove support for `--rebase=preserve`,
>>> 2021-09-07) we:
>>>
>>>     $ git -c pull.rebase=preserve pull
>>>     error: rebase.c:29: preserve: 'preserve' superseded by 'merges'
>>>     fatal: builtin/pull.c:45: Invalid value for pull.rebase: preserve
>>>
>>> I.e. we'd error before this, and the "preserve_merges_selected" variable
>>> being checked here is not affected by config, i.e. we only ever got to
>>> this "via config" route if "pull" et al was invoking us.
>>>
>>> But now that command dies.
>>>
>>> If there is still a codepath where we call "rebase --preserve-merges" on
>>> the basis of config that I've missed, shouldn't this die() be happening
>>> there?
>> Hi Ævar,
>>
>> The preserve merges is a pull config item, still supported by Visual
>> Studio, so could easily be set for many users. When they click on the
>> "Pull" menu and get the old die() fatal: message they won't know why
>> this happened or how to resolve it. Hence the extra info.
>>
>> If the user was actually running a rebase command then, yes, they
>> would/should be reasonably OK with the original error message telling
>> them what was wrong with their command line. But a `git pull`?
>> especially as the manual says nothing about preserve merges any more.
>>
>> If we are to remove a capability the `give up and die` messages should
>> be helpful in the edge cases. The issue (needing to check the pull, as
>> well as the rebase configs) has already shown on the git-users list. It
>> took a while to workout how it all happened.
>>
>> Not sure if I've covered your concerns properly, but this is one of the
>> places that can and warn the user.
>>
>>
> I don't think that came out well. For this message, it's about reminding
> users that they may *also* be using the `preserve` option within their
> pull options, and not just within their rebase command's options.
>
> A case of "don't use it here, and don't use it there either, please check".

I see. What I was confused with (and still find confusing) is that the
error here says "[and the pull.rebase=preserve config] may also invoke
this option".

But it doesn't do that at all, it *used to*, but now "git pull" will
promptly fail on it as well.

So this is really just trying to tell us something like this, right?

    Hey, you invoked --preserve-merges, bad mojo! Also: if you invoke
    'git pull' and used the related config you may or may not have used,
    that'll die too. So maybe check that out?

:)

Anyway, to the user the "invoke this option" isn't strictly accurate,
but they probably don't care/know the difference, so I don't mind
per-se, I was just wondering if I was missing something.

I do wonder if this part is needed at all. I.e. at this point this will
only benefit users who are *manually* invoking "git rebase
--preserve-merges", everyone else (including that "VS" example you
mentioned) will go through "git pull" and see the other error.

IOW maybe just saying "this option is an error now" when we intercept
the option is enough, and ditto for "this config is an error now" when
we intercept the config, and not assume that a user using the option
must also be using the config is simpler/sufficient.

Just my 0.02. For my part whahtever you decide to do here is fine by me,
I was just wondering if I'd misundestood the whole flow around this
legacy option and how we invoke the small parts of die() boilerplate
left of it.

  reply	other threads:[~2022-02-23 10:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 10:33 [PATCH 0/2] Update the die() preserve-merges messages to help some users Johannes Schindelin via GitGitGadget
2022-02-22 10:33 ` [PATCH 1/2] rebase: help user when dying with preserve-merges` Philip Oakley via GitGitGadget
2022-02-22 15:32   ` Ævar Arnfjörð Bjarmason
2022-02-22 16:06     ` Philip Oakley
2022-02-23 10:20       ` Ævar Arnfjörð Bjarmason
2022-02-23 17:44         ` Philip Oakley
2022-03-08 13:45           ` Ævar Arnfjörð Bjarmason
2022-02-22 10:33 ` [PATCH 2/2] rebase: `preserve` is also a pull option, tell dying users Philip Oakley via GitGitGadget
2022-02-22 15:34   ` Ævar Arnfjörð Bjarmason
2022-02-22 15:56     ` Philip Oakley
2022-02-22 17:48       ` Philip Oakley
2022-02-23 10:27         ` Ævar Arnfjörð Bjarmason [this message]
2022-03-04 14:29           ` Philip Oakley
2022-03-07 16:43             ` Johannes Schindelin
2022-03-07 23:26               ` Philip Oakley
2022-03-09 12:18                 ` Johannes Schindelin
2022-02-22 18:55 ` [PATCH 0/2] Update the die() preserve-merges messages to help some users Phillip Wood
2022-02-22 20:24   ` Philip Oakley

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=220223.86mtih6fai.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=philipoakley@iee.email \
    /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).