From patchwork Thu Feb 28 15:27:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 10833349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B5801399 for ; Thu, 28 Feb 2019 15:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE7C42E4B7 for ; Thu, 28 Feb 2019 15:27:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDBB72F26A; Thu, 28 Feb 2019 15:27:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF30A2E4B7 for ; Thu, 28 Feb 2019 15:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388355AbfB1P1s (ORCPT ); Thu, 28 Feb 2019 10:27:48 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:45683 "EHLO mail-ed1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730287AbfB1P1r (ORCPT ); Thu, 28 Feb 2019 10:27:47 -0500 Received: by mail-ed1-f46.google.com with SMTP id f19so7930527eds.12 for ; Thu, 28 Feb 2019 07:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:from:subject:fcc:content-transfer-encoding :mime-version:to:cc; bh=c74m5HW1PSJ8yk7fq8caGx90a6RJWjzD7CaeVDdYeco=; b=ippTgxCdOjWweZLddtxQli++UqHW9zbt81acBjmixJG5NmZWAzeUQcC2AzZMF0DGO0 Q8P7HplhZZlRQ5hHl9QPcyojIaeHD+IzJvD8CsSBV/wu2wRZNoA3L1QmSyjuSMpqT1PL lAXNAe2/qiolxbmEVhW/dG4GQFWWO+aibS/m22HfSrHMn+YqGH3SLPpFwaIm/EEDRpcg eHX7/CgyeHP9SF2nrLSxZ6JjCR6RxvSqjbyrapL34uvjlANsY0ffaXbre8l2SewUk4ec FN4l/jW3ZXlwz0OG0bnRUbZfFD3Hu02fkzbk9GZVY52TK8Uju76gjZpDG384WBMGKbT7 bILQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=c74m5HW1PSJ8yk7fq8caGx90a6RJWjzD7CaeVDdYeco=; b=qgxKRgNoybzzxX88UnIM4WYZA07+Qzdu+kNmsk3tDLOXd/hue8XBaIX0aEpmI2tdTC fXx2hchCsC1tCSnYI5AjlG6EYFGu1WTmMUvvNQ3SceIOEqha8Vp20ssclVRO6DerTlNp IQM9E9DneA+shaOfHmaHqyhUs0EHXRuiRIHMbS8eU+cEmcZ3ByiTQq1jLv4kEHP0I5LM GrImZl+Zjt7DLozkY+3T0++59CXqdGntj8CCMAJyKIvcctmw5jFT3L/nNrSfJoPlRMHT 6tph0g2RGLgywpyV32ensrrJUpRW4XbSjbYkq7plPkqPFYq4cACBf5fL7v2TEU8XJcPt VIPA== X-Gm-Message-State: APjAAAWN/cVFWKFTeSb2uzYJTPsF9EHMNp8Hu1/LTzK8txdo7fS0HnC+ OMLzx14RuEgpN0xpgo87ae9lD9V+ X-Google-Smtp-Source: APXvYqzXUJwyWmG1fcYrPTGAwcZ9KbcKg6GqmKrOeC+96ijGq1TnNeeoEwEMee3J3J7X/PNsL7C8uQ== X-Received: by 2002:a50:a4d5:: with SMTP id x21mr101492edb.189.1551367665294; Thu, 28 Feb 2019 07:27:45 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id me7sm3269339ejb.46.2019.02.28.07.27.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 07:27:44 -0800 (PST) Date: Thu, 28 Feb 2019 07:27:44 -0800 (PST) X-Google-Original-Date: Thu, 28 Feb 2019 15:27:40 GMT Message-Id: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 0/4] Fix ORIG_HEAD behavior of the built-in rebase Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Nazri Ramliy , Junio C Hamano Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It was reported by Nazri Ramliy that ORIG_HEAD was set incorrectly again, this time caused by the shortcut to call git am directly, without detouring to a Unix shell script. Patch 2/4 might look like something completely unrelated, but without it, the update to HEAD might use an incorrect reflog message. Patch 1/4 is more a "while at it" patch; while looking which code paths might need to update ORIG_HEAD, I noticed that this reset_head() call did unnecessary work. Johannes Schindelin (4): built-in rebase: no need to check out `onto` twice built-in rebase: use the correct reflog when switching branches built-in rebase: demonstrate that ORIG_HEAD is not set correctly built-in rebase: set ORIG_HEAD just once, before the rebase builtin/rebase.c | 37 +++++++++++++++++++++---------------- t/t3400-rebase.sh | 8 ++++++++ 2 files changed, 29 insertions(+), 16 deletions(-) base-commit: 21853626eac565dd42572d90724b29863f61eb3b Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-153%2Fdscho%2Frebase-am-and-orig-head-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-153/dscho/rebase-am-and-orig-head-v1 Pull-Request: https://github.com/gitgitgadget/git/pull/153