From: Markus Wiederkehr <markus.wiederkehr@gmail.com>
To: Git mailing list <git@vger.kernel.org>
Subject: Re: git rebase: retain original head?
Date: Wed, 9 Jan 2019 16:08:52 +0100 [thread overview]
Message-ID: <CA+h-Bnvp3mrXBqqY+mdD36feOkx1EhnnQtDXrmPhyW4KzKb_3w@mail.gmail.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1901091501320.41@tvgsbejvaqbjf.bet>
On Wed, Jan 9, 2019 at 3:05 PM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> Having said that, it is an unintended regression in the built-in rebase.
> Markus, could you come up with a minimal test case, preferably in the form
> of a patch to t/t3415-rebase-autosquash.sh?
I don't think I'm familiar enough with the test code to be able to
provide a good patch but the following code should illustrate the
regression.
git init testrepo
cd testrepo
echo 1 > file && git add file && git commit -m "initial"
echo 1 >> file && git commit -am "commit 1"
# rev_commit_1=$(git rev-parse HEAD)
echo 1 >> file && git commit -am "fixup! $(git rev-parse --short HEAD)"
echo 1 >> file && git commit -am "commit 3"
rev_orig_head=$(git rev-parse HEAD)
GIT_EDITOR=: git rebase --autosquash -i HEAD~3
test $(git rev-parse ORIG_HEAD) = $rev_orig_head
In older versions of git this test succeeded, i.e. ORIG_HEAD pointed
to the previous original head, $rev_orig_head. In git version 2.20.1
ORIG_HEAD now points to the commit that got fixuped instead,
$rev_commit_1.
In previous versions ORIG_HEAD only pointed somewhere else if "git
reset" was invoked manually during the rebase operation. I'm not sure
if this is desirable, maybe ORIG_HEAD should always point to the
previous head after rebase completes, no matter what operations were
run in between. What do you think?
Markus
next prev parent reply other threads:[~2019-01-09 15:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 15:06 git rebase: retain original head? Markus Wiederkehr
2019-01-08 17:43 ` Andreas Schwab
2019-01-08 20:38 ` Markus Wiederkehr
2019-01-08 20:51 ` Andreas Schwab
2019-01-09 13:48 ` Markus Wiederkehr
2019-01-08 21:22 ` Jacob Keller
2019-01-09 14:05 ` Johannes Schindelin
2019-01-09 15:08 ` Markus Wiederkehr [this message]
2019-01-11 10:42 ` Johannes Schindelin
2019-02-27 5:45 ` Nazri Ramliy
2019-02-28 10:10 ` Johannes Schindelin
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=CA+h-Bnvp3mrXBqqY+mdD36feOkx1EhnnQtDXrmPhyW4KzKb_3w@mail.gmail.com \
--to=markus.wiederkehr@gmail.com \
--cc=git@vger.kernel.org \
/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).