From: Junio C Hamano <gitster@pobox.com>
To: Sam Lee <skynare@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Reverting a range of commits with conflict
Date: Tue, 02 Apr 2019 09:50:16 +0900 [thread overview]
Message-ID: <xmqq36n1ut6f.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CACrt3pyZ7XNHLfFM46qymLYft4+jXSU_HBD2Wk+cL6MSzryFhA@mail.gmail.com> (Sam Lee's message of "Mon, 1 Apr 2019 13:25:54 -0400")
Sam Lee <skynare@gmail.com> writes:
> It brings up EDITOR twice and I end up with two commits.
> I can squash them. But, I don't know if this is a desired behavior.
It is my understanding that the users who do want a single revert of
multiple commits are expected to squash them (by choosing which ones
to squash into one), so if you really want to make them into one,
you can squash them and that is your desired behaviour. The point
is that you do not have to.
If you think a bit about it, it does not make much sense to leave
outstanding changes in limbo with --no-commit when you are picking
or reverting multiple commits. The first one may replay cleanly or
may not and needs manual resolution, but after that, the work you
did will only be in your working tree, and the difference between
that and the HEAD and the index is not recorded anywhere else. What
happens when the replaying (either cherry-picking or reverting) of
the second one had conflict? The effect of picking or reverting the
first one is now intermingled with the effect of the conflicted
picking or reverting of the second---with --no-commit, the workflow
is making the messy conflicted state needlessly larger.
prev parent reply other threads:[~2019-04-02 0:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 17:25 Reverting a range of commits with conflict Sam Lee
2019-04-02 0:50 ` 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=xmqq36n1ut6f.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=skynare@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).