Skip to content

Update the die() preserve-merges messages to help some users #1155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

dscho
Copy link
Member

@dscho dscho commented Feb 22, 2022

This small update to the die() preserve-merges messages is a response to the reported edge case in the Git-for-Windows googlegroups thread where even git rebase --continue would die.

It is most relevant for Windows because Visual Studio still offers the option to run git pull --preserve, therefore Git for Windows already applied these patches. The improvements are not specific to Windows, though, and should therefore also get into core Git, albeit at a more leisurely pace.

This is a companion patch series to git-for-windows#3708

cc: Ævar Arnfjörð Bjarmason [email protected]
cc: Phillip Wood [email protected]
cc: Philip Oakley [email protected]

Git will die if a "rebase --preserve-merges" is in progress.
Users cannot --quit, --abort or --continue the rebase.

This sceario can occur if the user updates their Git, or switches
to another newer version, after starting a preserve-merges rebase,
commonly via the pull setting.

One trigger is an unexpectedly difficult to resolve conflict, as
reported on the `git-users` group.
(https://groups.google.com/g/git-for-windows/c/3jMWbBlXXHM)

Tell the user the cause, i.e. the existence of the directory.
The problem must be resolved manually, `git rebase --<option>`
commands will die, or the user must downgrade. Also, note that
the deleted options are no longer shown in the documentation.

Signed-off-by: Philip Oakley <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
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 <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Member Author

dscho commented Feb 22, 2022

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Feb 22, 2022

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1155/dscho/die_preserve-v1

To fetch this version to local tag pr-1155/dscho/die_preserve-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1155/dscho/die_preserve-v1

@@ -1181,7 +1181,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
strbuf_reset(&buf);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):


On Tue, Feb 22 2022, Philip Oakley via GitGitGadget wrote:

> From: Philip Oakley <[email protected]>
>
> Git will die if a "rebase --preserve-merges" is in progress.
> Users cannot --quit, --abort or --continue the rebase.
>
> This sceario can occur if the user updates their Git, or switches
> to another newer version, after starting a preserve-merges rebase,
> commonly via the pull setting.
>
> One trigger is an unexpectedly difficult to resolve conflict, as
> reported on the `git-users` group.
> (https://groups.google.com/g/git-for-windows/c/3jMWbBlXXHM)
>
> Tell the user the cause, i.e. the existence of the directory.
> The problem must be resolved manually, `git rebase --<option>`
> commands will die, or the user must downgrade. Also, note that
> the deleted options are no longer shown in the documentation.

I can go and read the linked thread for the answer, but:

>  		if (is_directory(buf.buf)) {
> -			die("`rebase -p` is no longer supported");
> +			die("`rebase --preserve-merges` (-p) is no longer supported.\n"
> +			"You still have a `.git/rebase-merge/rewritten` directory, \n"
> +			"indicating a `rebase preserve-merge` is still in progress.\n");
>  		} else {
>  			strbuf_reset(&buf);
>  			strbuf_addf(&buf, "%s/interactive", merge_dir());

As much of an improvement this is, I'd be no closer to knowing what I
should do at this point.

Should I "rm -rf" that directory, downgrade my version of git if I'd
like to recover my work (as the message alludes to).

In either case I'd think that this is getting a bit past the length
where we'd have just a die() v.s. splitting it into a die()/advise()
pair. I.e. to have the advise() carry some bullet-point list about X/Y/Z
solutions, with the die() being a brief ~"we did because xyz dir is
still here".


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):


On Wed, Feb 23 2022, Philip Oakley wrote:

> On 23/02/2022 10:20, Ævar Arnfjörð Bjarmason wrote:
>> On Tue, Feb 22 2022, Philip Oakley wrote:
>>
>>> On 22/02/2022 15:32, Ævar Arnfjörð Bjarmason wrote:
>>>> On Tue, Feb 22 2022, Philip Oakley via GitGitGadget wrote:
>>>>
>>>>> From: Philip Oakley <[email protected]>
>>>>>
>>>>> Git will die if a "rebase --preserve-merges" is in progress.
>>>>> Users cannot --quit, --abort or --continue the rebase.
>>>>>
>>>>> This sceario can occur if the user updates their Git, or switches
>>>>> to another newer version, after starting a preserve-merges rebase,
>>>>> commonly via the pull setting.
>>>>>
>>>>> One trigger is an unexpectedly difficult to resolve conflict, as
>>>>> reported on the `git-users` group.
>>>>> (https://groups.google.com/g/git-for-windows/c/3jMWbBlXXHM)
>>>>>
>>>>> Tell the user the cause, i.e. the existence of the directory.
>>>>> The problem must be resolved manually, `git rebase --<option>`
>>>>> commands will die, or the user must downgrade. Also, note that
>>>>> the deleted options are no longer shown in the documentation.
>>>> I can go and read the linked thread for the answer, but:
>>>>
>>>>>  		if (is_directory(buf.buf)) {
>>>>> -			die("`rebase -p` is no longer supported");
>>>>> +			die("`rebase --preserve-merges` (-p) is no longer supported.\n"
>>>>> +			"You still have a `.git/rebase-merge/rewritten` directory, \n"
>>>>> +			"indicating a `rebase preserve-merge` is still in progress.\n");
>>>>>  		} else {
>>>>>  			strbuf_reset(&buf);
>>>>>  			strbuf_addf(&buf, "%s/interactive", merge_dir());
>>>> As much of an improvement this is, I'd be no closer to knowing what I
>>>> should do at this point.
>>>>
>>>> Should I "rm -rf" that directory, downgrade my version of git if I'd
>>>> like to recover my work (as the message alludes to).
>>>>
>>>> In either case I'd think that this is getting a bit past the length
>>>> where we'd have just a die() v.s. splitting it into a die()/advise()
>>>> pair. I.e. to have the advise() carry some bullet-point list about X/Y/Z
>>>> solutions, with the die() being a brief ~"we did because xyz dir is
>>>> still here".
>>>>
>>>>
>>> Hi Ævar,
>>>
>>> Exactly. This is a slightly special, but real, case. The previous
>>> message was essentially totally opaque to users. An "If I were you I
>>> wouldn't start from here" response is somewhat true, so we simply tell
>>> the user how they got to receive the fatal message. They can then take
>>> any of the options they choose.
>>>
>>> Ultimately the user downgraded and managed to use "rebase --continue",
>>> as advised by Git, without the response "fatal:" to complete their old
>>> preserve-merges rebase.
>> Right. I'm pointing out that in this proposed version of the die()
>> message we stop just short of actually telling the user how to proceed.
>>
>> I.e. just that they have a X directory, not that they should either
>> remove X and lose their work, or downgrade git, proceed, and then
>> upgrade git.
> In a sense, that is it. They are in a difficult place, but with at least
> a little information to seek further information and start making their
> choices. Before, they (users in difficulty) were rather uninformed.

Yes, it's definitely an improvement. I'm just wondering if we can tell
them a bit more so that they're not needing to search "what do do about
.git/rebase-merge/rewritten" on Google/stackoverflow/whatever.

I.e. can we just specifically say that they either need to downgrade,
continue, upgrade, or alternatively rm -rf it, depending on wheher
they'd like to not lose their work, or if that's OK?

>>> They'll hit a similar fault in short order because when they next `pull`
>>> they'll be slipped into trying the preserve-merge rebase again - that's
>>> the 2/2 patch, making sure they know why.
>> Well, this is "rebase". You can have been running rebases in a
>> repository without ever having any interactions with remotes.
> True. That is a possibility. But we have also removed the preserve
> option for interaction with remotes as well.

*Nod*, presumably you mean its removal from "builtin/pull.c" etc.
>>
>> And even if you had interactions with remotes you might be doing so via
>> "git fetch" followed by "git rebase", and might not ever invoke "git
>> pull".
>>
>> And even if you did a "git pull" later shouldn't the error you got here
>> be sufficiently stand-alone as to tell you what to do, without needing a
>> later "pull"?
> Why are we delaying telling the user that they would have problems there
> as well? It shouldn't be a game about how many ways we can trip up the user.
>
> It's a pity the problem has split into the different ways into disaster.

I'm just saying that the reason the message is a bit confusing is
because we *are* delaying it. I.e. we could give a more specific error
message in builtin/pull.c, but the "preserve merges" scaffolding was
already removed from it.

Which is why we're doing it in builtin/rebase.c, and suggesting "tweak
your pull settings", to a user who may or may not have arrived there
after a "pull" (and may not be using remotes at all).

I think overall that's OK in this case, i.e. this fix shouldn't be held
up by putting that scaffolding in place in builtin/pull.c again to
slightly improve the error.

But perhaps in the 2/2 error just say instead: "if you arrived here via
'git pull' ....". I.e. no extra code, just a slight tweak to the
message, and any user seeing it by invoking "rebase" directly won't be
further confused about why the error is saying something about "pull"
(which they didn't run).

@gitgitgadget
Copy link

gitgitgadget bot commented Feb 22, 2022

User Ævar Arnfjörð Bjarmason <[email protected]> has been added to the cc: list.

@@ -1181,7 +1181,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
strbuf_reset(&buf);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):


On Tue, Feb 22 2022, Philip Oakley via GitGitGadget wrote:

> From: Philip Oakley <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Johannes Schindelin <[email protected]>
> ---
>  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?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Philip Oakley wrote (reply to this):

Sorry for the delay. I've got some on-going family matters to attend to
which have limited my availablilty.

On 23/02/2022 10:27, Ævar Arnfjörð Bjarmason wrote:
> 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 <[email protected]>
>>>>>
>>>>> 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 <[email protected]>
>>>>> Signed-off-by: Johannes Schindelin <[email protected]>
>>>>> ---
>>>>>  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.

Ok, That's probably my local idiom that confusing the now of the error
and the past when the config would have been set up. I'll see if I can
clarify that better.
> 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.
Error reporting is a tricky subject, especially when we add the human
error and misunderstanding aspects into the mix.
>
> 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.
Yep, it is tricky talking about disappeared options, the error messages,
and the multiple ways that show themselves. In the originating edge case
it wasn't helped by a Git advice message that contained the failing
command line (`git rebase --continue`) suggestion. In general I was
trying to cover all the possible sources in all the places the 'error'
may occur.

I'll have another look at the ways these edge cases could appear, and
try an improve the commit message explanations where the diff doesn't
show sufficient context. It'll be at least next week.

Philip

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Johannes Schindelin wrote (reply to this):

Hi Philip,

On Fri, 4 Mar 2022, Philip Oakley wrote:

> I'll have another look at the ways these edge cases could appear, and
> try an improve the commit message explanations where the diff doesn't
> show sufficient context. It'll be at least next week.

Can I punt this patch series back to you? (I sent it upstream on your
behalf because I had assumed that you'd want me to, sorry for
misunderstanding your intentions.)

Ciao,
Dscho

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Philip Oakley wrote (reply to this):

Hi Dscho,

On 07/03/2022 16:43, Johannes Schindelin wrote:
> Hi Philip,
>
> On Fri, 4 Mar 2022, Philip Oakley wrote:
>
>> I'll have another look at the ways these edge cases could appear, and
>> try an improve the commit message explanations where the diff doesn't
>> show sufficient context. It'll be at least next week.
> Can I punt this patch series back to you? (I sent it upstream on your
> behalf because I had assumed that you'd want me to, sorry for
> misunderstanding your intentions.)
>
I'm happy to continue to work on this series, and am grateful for your
support in pushing it through GGG. How is it best to transfer the
'ownership' at GGG?

I've still got some family issues so it'll be later in the week, or even
next week before I can update the series.

Thanks.
Philip

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Johannes Schindelin wrote (reply to this):

Hi Philip,

On Mon, 7 Mar 2022, Philip Oakley wrote:

> On 07/03/2022 16:43, Johannes Schindelin wrote:
> > Hi Philip,
> >
> > On Fri, 4 Mar 2022, Philip Oakley wrote:
> >
> >> I'll have another look at the ways these edge cases could appear, and
> >> try an improve the commit message explanations where the diff doesn't
> >> show sufficient context. It'll be at least next week.
> > Can I punt this patch series back to you? (I sent it upstream on your
> > behalf because I had assumed that you'd want me to, sorry for
> > misunderstanding your intentions.)
> >
> I'm happy to continue to work on this series, and am grateful for your
> support in pushing it through GGG. How is it best to transfer the
> 'ownership' at GGG?

Sadly, I don't know of any way how I could transfer ownership to you, but
maybe you can just open a new one and reference the first thread in the
cover letter?

> I've still got some family issues so it'll be later in the week, or even
> next week before I can update the series.

Sorry to hear that you have issues. These are tough times, and I feel for
you.

Ciao,
Dscho

@dscho dscho self-assigned this Feb 22, 2022
@gitgitgadget
Copy link

gitgitgadget bot commented Feb 22, 2022

On the Git mailing list, Phillip Wood wrote (reply to this):

Hi Philip

On 22/02/2022 10:33, Johannes Schindelin via GitGitGadget wrote:
> This small update to the die() preserve-merges messages is a response to the
> reported edge case in the Git-for-Windows googlegroups thread
> [https://groups.google.com/g/git-for-windows/c/3jMWbBlXXHM] where even git
> rebase --continue would die.
> > It is most relevant for Windows because Visual Studio still offers the
> option to run git pull --preserve, therefore Git for Windows already applied
> these patches. The improvements are not specific to Windows, though, and
> should therefore also get into core Git, albeit at a more leisurely pace.

I think the new messages are an improvement, I was wondering how difficult it would be to allow the user to run rebase --abort so they can at least easily start again with --rebase-merges.

Best Wishes

Phillip

> This is a companion patch series to
> https://github.com/git-for-windows/git/pull/3708
> > Philip Oakley (2):
>    rebase: help user when dying with preserve-merges`
>    rebase: `preserve` is also a pull option, tell dying users
> >   builtin/rebase.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> > > base-commit: e6ebfd0e8cbbd10878070c8a356b5ad1b3ca464e
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1155%2Fdscho%2Fdie_preserve-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1155/dscho/die_preserve-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/1155

@gitgitgadget
Copy link

gitgitgadget bot commented Feb 22, 2022

User Phillip Wood <[email protected]> has been added to the cc: list.

@gitgitgadget
Copy link

gitgitgadget bot commented Feb 22, 2022

On the Git mailing list, Philip Oakley wrote (reply to this):

Hi Phillip,

On 22/02/2022 18:55, Phillip Wood wrote:
> Hi Philip
>
> On 22/02/2022 10:33, Johannes Schindelin via GitGitGadget wrote:
>> This small update to the die() preserve-merges messages is a response
>> to the
>> reported edge case in the Git-for-Windows googlegroups thread
>> [https://groups.google.com/g/git-for-windows/c/3jMWbBlXXHM] where
>> even git
>> rebase --continue would die.
>>
>> It is most relevant for Windows because Visual Studio still offers the
>> option to run git pull --preserve, therefore Git for Windows already
>> applied
>> these patches. The improvements are not specific to Windows, though, and
>> should therefore also get into core Git, albeit at a more leisurely
>> pace.
>
> I think the new messages are an improvement, I was wondering how
> difficult it would be to allow the user to run rebase --abort so they
> can at least easily start again with --rebase-merges.

In this case, the user (another Phillip), couldn't run `rebase
--continue` without getting a `fatal:` report. A code inspection showed
that was one of the first tests so I don't believe they could run
`--quit` or `abort` either!

We eventually nailed it down to being an update of Git, after getting
into a bad conflict resolution, so the update refused to do any rebase
commands! Later they tried downgrading and finishing the rebase that way
in the usual 'hack & hope' way. Luckily they had a backup from the time
of the update, which was able to confirm the presence of the indicative
directory (which is an implementation detail).

If the `rebase abort` was moved earlier in the code, then it might work,
but we'd still need to keep the clean-up code for a non-existent option,
which is less than ideal .

Philip

>
> Best Wishes
>
> Phillip
>
>> This is a companion patch series to
>> https://github.com/git-for-windows/git/pull/3708
>>
>> Philip Oakley (2):
>>    rebase: help user when dying with preserve-merges`
>>    rebase: `preserve` is also a pull option, tell dying users
>>
>>   builtin/rebase.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>>
>> base-commit: e6ebfd0e8cbbd10878070c8a356b5ad1b3ca464e
>> Published-As:
>> https://github.com/gitgitgadget/git/releases/tag/pr-1155%2Fdscho%2Fdie_preserve-v1
>> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git
>> pr-1155/dscho/die_preserve-v1
>> Pull-Request: https://github.com/gitgitgadget/git/pull/1155
>

@gitgitgadget
Copy link

gitgitgadget bot commented Feb 22, 2022

User Philip Oakley <[email protected]> has been added to the cc: list.

@dscho
Copy link
Member Author

dscho commented May 21, 2022

@PhilipOakley I see you're active commenting on issues again, could you take another look at sending a new iteration for this PR?

@PhilipOakley
Copy link

It's on my list.
As noted above, I'll probably use the format-patch; send-email method as the ggg is still tied to yourself (as I understand it).
The main update will be to allow the rebase --abort command, even when a --preserve is in progress, which was previously not allowed as an unintended consequence of removing the preserve merge option.

@dscho
Copy link
Member Author

dscho commented May 22, 2022

You could simply open a new PR and mention this PR in the cover letter.

@PhilipOakley
Copy link

@dscho Is there a way of accessing (fetching) this PR?

I've got the remote gitgitgadget https://github.com/gitgitgadget/git.git (fetch) but when fetched only appears to have those series that Junio has picked up.

My fetch refspec is fetch = +refs/heads/*:refs/remotes/gitgitgadget/* (is there an easy way to extract that, apart from looking at the config file - the man page gives no hint?).

At the moment lurching from the Git & GfW drafts to get a bit of clarity on the various drafts I have.

@dscho
Copy link
Member Author

dscho commented May 24, 2022

Yes, but those refs are not fetched by default: refs/pull/<pr-number>/head. Also see the "Fetch-it-via" footers of the cover letters.

@PhilipOakley
Copy link

I'd forgotten about the the base-commit: part.

The example fetch in the [patch 0] is for a URL, without a destinations - something I've not tried to do before, so I'm tying myself in knots on the right refspec (taking some insight from https://gist.github.com/piscisaureus/3342247).

@dscho
Copy link
Member Author

dscho commented May 25, 2022

The example fetch in the [patch 0] is for a URL, without a destination

It is:

Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1155/dscho/die_preserve-v1

When you execute that, Git will tell you where it stored the result: in FETCH_HEAD. From there, you can create a new branch e.g. via git switch -c die-preserve FETCH_HEAD.

@PhilipOakley PhilipOakley mentioned this pull request May 26, 2022
@dscho
Copy link
Member Author

dscho commented May 27, 2022

superseded by #1242

@dscho dscho closed this May 27, 2022
@dscho dscho deleted the die_preserve branch June 7, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants