From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id A1A6C211B4 for ; Fri, 11 Jan 2019 10:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729624AbfAKKm0 (ORCPT ); Fri, 11 Jan 2019 05:42:26 -0500 Received: from mout.gmx.net ([212.227.15.19]:52105 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728862AbfAKKm0 (ORCPT ); Fri, 11 Jan 2019 05:42:26 -0500 Received: from [192.168.0.129] ([37.201.193.149]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lx8OH-1hJbYX1UhV-016gD7; Fri, 11 Jan 2019 11:42:24 +0100 Date: Fri, 11 Jan 2019 11:42:08 +0100 (STD) From: Johannes Schindelin X-X-Sender: virtualbox@gitforwindows.org To: Markus Wiederkehr cc: Git mailing list Subject: Re: git rebase: retain original head? In-Reply-To: Message-ID: References: <87va2zavu1.fsf@igel.home> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K1:dixTm7xYMl3jXwQHcA2VgUQ4XSkpnPYqvkCnRvl0i0YjiBXbeAB VwkWDEAUswMCTp8MgpyNcpd44X3I7AjXhuscnwuYL8Cwx/luZ8M+K2RuPx70meywy+G/FT7 1YyWyB6M8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uJfUW+DiMPwvB7ePlvLN1Fw2UGniBMH+yPL5 NVF21sYWciw== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Markus, On Wed, 9 Jan 2019, Markus Wiederkehr wrote: > On Wed, Jan 9, 2019 at 3:05 PM Johannes Schindelin > 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. I think that you think you're too unfamiliar with the test code only because you have not had a look. > git init testrepo > cd testrepo > echo 1 > file && git add file && git commit -m "initial" test_commit initial > echo 1 >> file && git commit -am "commit 1" test_commit 1 initial.t > # rev_commit_1=$(git rev-parse HEAD) > echo 1 >> file && git commit -am "fixup! $(git rev-parse --short HEAD)" test_commit "fixup! 1" initial.t > echo 1 >> file && git commit -am "commit 3" test_commit 3 initial.t > rev_orig_head=$(git rev-parse HEAD) > GIT_EDITOR=: git rebase --autosquash -i HEAD~3 > test $(git rev-parse ORIG_HEAD) = $rev_orig_head test_cmp_rev $rev_orig_head ORIG_HEAD I leave it to you to make the actual patch. Ciao, Johannes > > 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 >