From: Junio C Hamano <gitster@pobox.com>
To: "Thomas Bétous" <th.betous@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug Report: "git reset --hard" does not cancel an on-going rebase
Date: Mon, 31 Aug 2020 16:11:45 -0700 [thread overview]
Message-ID: <xmqqimcye7gu.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <34B7EFB9-8710-4993-ACCD-604313D543E7@gmail.com> ("Thomas Bétous"'s message of "Mon, 31 Aug 2020 23:59:38 +0200")
Thomas Bétous <th.betous@gmail.com> writes:
> I would like to report an inconsistent behavior of the
> rebase/reset commands. I don’t know whether it is an actual bug
> or something else but according to me something is not right.
> When a rebase gets paused (because of a conflict for instance) I
> would expect the command "git reset --hard" to cancel this
> on-going rebase but it does not. I expect this because for
> instance "git reset --hard" cancels a cherry-pick in the same use
> case so I think the behavior of these 2 commands should be
> consistent.
It is reasonable and desirable for multi-commit operations like
"rebase", "cherry-pick A..B" and "revert A..B" not to abort the
entire sequence with a mere "reset --hard". After a step resulted
in conflicts, the user may try to resolve them, getting into too
deep a hole by botching resolution, and wish to redo the current
step from scratch, and "reset --hard" can be a way to clean the
slate before recreating the same conflict. To abort the whole
thing, "rebase --abort" and "cherry-pick --abort" would be needed
to differentiate from the "clean this single step" request made with
"reset --hard".
On the other hand, operations on a single commit like "cherry-pick
X" does not have to retain "what to do after we have dealt with the
current step", so "reset --hard" that finishes the whole thing
(after all, the whole thing is the single step that may have
conflicted) would just be a convenient short-hand.
prev parent reply other threads:[~2020-08-31 23:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 21:59 Bug Report: "git reset --hard" does not cancel an on-going rebase Thomas Bétous
2020-08-31 23:11 ` Junio C Hamano [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqimcye7gu.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=th.betous@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.
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 NNTP newsgroup(s).