From patchwork Tue Aug 10 09:31:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood X-Patchwork-Id: 12428449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C44DAC4338F for ; Tue, 10 Aug 2021 09:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5C5E61076 for ; Tue, 10 Aug 2021 09:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239067AbhHJJcZ (ORCPT ); Tue, 10 Aug 2021 05:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236507AbhHJJcY (ORCPT ); Tue, 10 Aug 2021 05:32:24 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203C2C0613D3 for ; Tue, 10 Aug 2021 02:32:02 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id r6so3098606wrt.4 for ; Tue, 10 Aug 2021 02:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=L+KY8cxN8DDMbCjTy5FouBzRyhVwPOvd/APeFziK638=; b=VH87lXXzAJWX0SLIJ9uOxfFJDJy7P9Liqlc92sfklbD/3OAijBXqUxs8sXBoVh6dqN Zc94htyJ+7OaVxQpr8zCGQJcKjHm0aJPFnwXN/xOxdCMS8lAjLW9Zil6A8I67nnNIJ4m 2AlKlW7nWsHy7xw8l3bZ78GTfEqI6HWl65nYhplpkEzU1xVXSmL/+btU5pH54agWi98i 61LkdurgboFs35qfzah9lzZ+aAiR4B3ydhnbADEC1B8wYi1kHdBIVwLN4INS1uax7VYb ZNOBghrx10ZtPIeDffCrLz0i76EF/yJ1jKqL9VZ2gGZFu7KLATqO03k7qyx+ZSheVyVA sEJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=L+KY8cxN8DDMbCjTy5FouBzRyhVwPOvd/APeFziK638=; b=P2HjhJUPX5LJ1OQgJhwOj3UewOKleXToSPb4WVY6KkuuF9NS6WDrhC2EKoI4vxYCxF OwBEPp9q4tSajdf4zTnM+eCpOy4c1BtYv5WcYVUq1MMGWT/M0OSGeOIfpTmzX9eWV3av Ua4JyDsnFugpgpsP+FiDSliGd1UwvErjb8w0lc4r+y3KnW8J0eex6F2mltLRlTjt8OAe lBE+kac06OhDTIdQDH8/T/GlEoI+sJvepJ4ci7GcLHuaq0M2VIsn4WhufKbloiCPQmY9 KAZmUq6yTUR5Y47E26GDmptvMjVuY+ivT3khrH0niBGu0LFC4dxfARzPP7+PLw5297Ot C9Wg== X-Gm-Message-State: AOAM533/ODWZTrGuDsk1AJTwVWTtSfm3wYI/2e4qIMcrumRXzw0o79KO TZEq44ZmxEFRSSs2K/cvBUUtpvPtc1Y= X-Google-Smtp-Source: ABdhPJxbGDg0NzeEFpSv879bjVDPifIVNouCb/g8SjX4BPglCBXNduOhmk6eCje8ky9Dx5iIKjiPsQ== X-Received: by 2002:adf:d085:: with SMTP id y5mr29510050wrh.272.1628587920765; Tue, 10 Aug 2021 02:32:00 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k17sm3084820wmj.0.2021.08.10.02.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 02:32:00 -0700 (PDT) Message-Id: <7559781ca92096f89a6dcbfeeaa4d2b4d7b98094.1628587917.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 10 Aug 2021 09:31:55 +0000 Subject: [PATCH 1/3] t3403: fix commit authorship Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victor Gambier , Elijah Newren , Johannes Schindelin , Phillip Wood , Phillip Wood Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Phillip Wood From: Phillip Wood Setting GIT_AUTHOR_* when committing with --amend will only change the author if we also pass --reset-author Signed-off-by: Phillip Wood --- t/t3403-rebase-skip.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh index e26762d0b29..6365c5af2f7 100755 --- a/t/t3403-rebase-skip.sh +++ b/t/t3403-rebase-skip.sh @@ -36,7 +36,8 @@ test_expect_success setup ' test_tick && GIT_AUTHOR_NAME="Another Author" \ GIT_AUTHOR_EMAIL="another.author@example.com" \ - git commit --amend --no-edit -m amended-goodbye && + git commit --amend --no-edit -m amended-goodbye \ + --reset-author && test_tick && git tag amended-goodbye && From patchwork Tue Aug 10 09:31:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood X-Patchwork-Id: 12428451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60700C4338F for ; Tue, 10 Aug 2021 09:32:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 430E061051 for ; Tue, 10 Aug 2021 09:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239078AbhHJJc1 (ORCPT ); Tue, 10 Aug 2021 05:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239040AbhHJJcY (ORCPT ); Tue, 10 Aug 2021 05:32:24 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1394C0613D3 for ; Tue, 10 Aug 2021 02:32:02 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id c9so25309554wri.8 for ; Tue, 10 Aug 2021 02:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=5eauvRzKXs+QohIxCKuhe2Cg3rOlP7zCo/M+3cntNo0=; b=D/5hFwtlY0VhDys4s6E3feCJU8C5G4ns7VP8t+bn2jdGUK1eKRuEwnl/FV12pC3CO9 QmhuK4zcANMnNP9WDbGEcb7stEJPsUaqveHWQZJE+x9z+FkYtJuaqWIwK6A3J8uB6xKc NBjJPVuDDPaoPVmd6qkOhXgGrypBZaq0hGDs2D7iW7gepR4/C7PVyzPGaFN955jE788u lrTtZeT6CDDZKqQT2RP8lvj2cHHCcPaUbsx0Ge2CkSsD2R9E0n0zKOueqJ4wEI/sAffo xnGk/7YVu1TfW8O0SbFsGo6m/XoWNDGrAPwHgz1jU8C9Lw5JqkMYWScpsk83unTDPaXf v6dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=5eauvRzKXs+QohIxCKuhe2Cg3rOlP7zCo/M+3cntNo0=; b=p5BAsk5wOn5VXk4tLZ+mesAw8qztxWxMTGrvJ++uHHDgb8QQv09r3RpQoH8DKgzoh+ +MixrTfnhLPh51/YHF98bDrZ9JMs1cMrj45T0M4DFSr7go9xhZxqwTgOXrPDCd0Lec4t 5ngIZb7pm5DWhzk+w92Z+mca+NsLf966Dk243AxFyy6juMEsDRcKx6GCszsVpAz6Zgb6 fxeirBIz8bpnBjaAgIrQXFRDv+5DkR+VtNfjlPqU768mOezBQlcKLhVAz8GE+hkNs94j EqI6WN6QlDab6ZOvq62zg8JZqj/lx7H2AvL97QFRPtBlnCBogNE09I22NFYdSK92Y8Ky ZwGQ== X-Gm-Message-State: AOAM532hZ4IemvGh0ZZVibwMmgbwRZ4QQ98wBHzvhztMg6aYEaMOcmHL DiuRv4BH7BJ9GzS73d1yqlBUUX/+lQ4= X-Google-Smtp-Source: ABdhPJwfD7veObq5TDL/IxxDcR7EbJl1OCN4SP8GWqQt73+iVMJ80AAC0OYbh47MT4MpzsUl5tk88A== X-Received: by 2002:a5d:688c:: with SMTP id h12mr2107731wru.313.1628587921369; Tue, 10 Aug 2021 02:32:01 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id e3sm23031542wrv.65.2021.08.10.02.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 02:32:01 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Tue, 10 Aug 2021 09:31:56 +0000 Subject: [PATCH 2/3] rebase --apply: restore some tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victor Gambier , Elijah Newren , Johannes Schindelin , Phillip Wood , Phillip Wood Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Phillip Wood From: Phillip Wood 980b482d28 ("rebase tests: mark tests specific to the am-backend with --am", 2020-02-15) sought to prepare tests testing the "apply" backend in preparation for 2ac0d6273f ("rebase: change the default backend from "am" to "merge"", 2020-02-15). However some tests seem to have been missed leading to us testing the "merge" backend twice. This patch fixes some cases that I noticed while adding tests to these files, I have not audited all the other rebase test files. Signed-off-by: Phillip Wood --- t/t3403-rebase-skip.sh | 2 +- t/t3418-rebase-continue.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh index 6365c5af2f7..a44e68d0ffb 100755 --- a/t/t3403-rebase-skip.sh +++ b/t/t3403-rebase-skip.sh @@ -52,7 +52,7 @@ test_expect_success setup ' ' test_expect_success 'rebase with git am -3 (default)' ' - test_must_fail git rebase main + test_must_fail git rebase --apply main ' test_expect_success 'rebase --skip can not be used with other options' ' diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh index f4c2ee02bc9..e4cb8be0418 100755 --- a/t/t3418-rebase-continue.sh +++ b/t/t3418-rebase-continue.sh @@ -36,7 +36,7 @@ test_expect_success 'non-interactive rebase --continue works with touched file' git reset --hard && git checkout main && - test_must_fail git rebase --onto main main topic && + test_must_fail git rebase --apply --onto main main topic && echo "Resolved" >F2 && git add F2 && test-tool chmtime =-60 F1 && @@ -254,7 +254,7 @@ test_rerere_autoupdate () { ' } -test_rerere_autoupdate +test_rerere_autoupdate --apply test_rerere_autoupdate -m GIT_SEQUENCE_EDITOR=: && export GIT_SEQUENCE_EDITOR test_rerere_autoupdate -i From patchwork Tue Aug 10 09:31:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood X-Patchwork-Id: 12428453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58F21C4338F for ; Tue, 10 Aug 2021 09:32:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4240A60EE9 for ; Tue, 10 Aug 2021 09:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239068AbhHJJcl (ORCPT ); Tue, 10 Aug 2021 05:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239064AbhHJJcZ (ORCPT ); Tue, 10 Aug 2021 05:32:25 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CFEBC0613D3 for ; Tue, 10 Aug 2021 02:32:03 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id h14so25330361wrx.10 for ; Tue, 10 Aug 2021 02:32:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=aoHsLaLvXroLoqaFJt+ljaDNoAaHQugE9clzB7+FviU=; b=cEcTEVkzJPmF2aNqT4TgtDEUlk9o4EcBahIgH4ivZsFxxguJH+ldSNiiFGhyGpAj+Y eGJQL0GqnbuG/84cVs2KXUqQP7uixacN455wg/oZmW7voWM+1Z58SuQy6dbYyLzhq0xf ZCR6nky1urS1U+q65eMOX0ig9lqFFFkQlwaCWm+9ZfnZ4XacoXfYsXvK46LTldVczVRK GZkt+EkdQlEEfDFqDXT7+GVDW14f9oiBMJwpYhUzYGNGHqxEEE0iisv31+YJuGQvFc6X gn2ooOi0tn92hHCMWKh0+jSjvu9/Mg3yzPE4WA8ZqryPH66Xjap6mFZIcHeKxmqKUPwp 7Afg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=aoHsLaLvXroLoqaFJt+ljaDNoAaHQugE9clzB7+FviU=; b=VJ1mnnCQTmyhgz6w2XroVXeGaUeQZs4dW1va+q8lfrLqwx3IzFgY3EEk+4f7sgFPqf nnognmJwq7yjAb+DT3+AN3gt+aXFE3zIePdYfkr2wW8e6Xd8GQJ3+jXW3QtdHhPdZBX1 CY2QACkw4CbZ81vdF2pIm49UyE7+N4tBjBb51ARGaNyT8ISa2G9yFKBWU/KYrq6Uk69e C4EnYdiHoPFooN49ilRInSo2r66wB4siAsu2KDThvKBBlNyRg0zZFdPekaTOoIE2trFO yhiEQvep6XkBlekuMdgR9+ewHmt/Kr8TgINpN9CBvT0Z8+S3caZIpH6BqB4/WyLa4Ld2 w9kA== X-Gm-Message-State: AOAM530Ibj7oabdFLZ3l8b5BRxpbrvJbeYcrrF4UYFPT11rMlsTIWde6 zXZ30fV7IsLyVX1EE5Gdv6d0mAC1vCY= X-Google-Smtp-Source: ABdhPJwqaZm+HT4cYLO0huNlYQVNbL0ON7W9XZhTcJeY1ihjfl3lT6gnH9FiyPWafq9wyJCsJxdnEA== X-Received: by 2002:a5d:4ec4:: with SMTP id s4mr12123166wrv.245.1628587922057; Tue, 10 Aug 2021 02:32:02 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z5sm7474004wmi.36.2021.08.10.02.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 02:32:01 -0700 (PDT) Message-Id: <6a63b657f1313ea6d4141c37a7c24bca691ce107.1628587917.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 10 Aug 2021 09:31:57 +0000 Subject: [PATCH 3/3] rebase --continue: remove .git/MERGE_MSG Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Victor Gambier , Elijah Newren , Johannes Schindelin , Phillip Wood , Phillip Wood Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Phillip Wood From: Phillip Wood If the user skips the final commit by removing all the changes from the index and worktree with 'git restore' (or read-tree) and then runs 'git rebase --continue' .git/MERGE_MSG is left behind. This will seed the commit message the next time the user commits which is not what we want to happen. Reported-by: Victor Gambier Signed-off-by: Phillip Wood --- sequencer.c | 3 +++ t/t3403-rebase-skip.sh | 8 ++++++++ t/t3418-rebase-continue.sh | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/sequencer.c b/sequencer.c index 7f07cd00f3f..52c7b461179 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4716,6 +4716,9 @@ static int commit_staged_changes(struct repository *r, refs_delete_ref(get_main_ref_store(r), "", "CHERRY_PICK_HEAD", NULL, 0)) return error(_("could not remove CHERRY_PICK_HEAD")); + if (unlink(git_path_merge_msg(r)) && errno != ENOENT) + return error_errno(_("could not remove '%s'"), + git_path_merge_msg(r)); if (!final_fixup) return 0; } diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh index a44e68d0ffb..f6e48644978 100755 --- a/t/t3403-rebase-skip.sh +++ b/t/t3403-rebase-skip.sh @@ -20,6 +20,7 @@ test_expect_success setup ' git add hello && git commit -m "hello" && git branch skip-reference && + git tag hello && echo world >> hello && git commit -a -m "hello world" && @@ -96,6 +97,13 @@ test_expect_success 'moved back to branch correctly' ' test_debug 'gitk --all & sleep 1' +test_expect_success 'skipping final pick removes .git/MERGE_MSG' ' + test_must_fail git rebase --onto hello reverted-goodbye^ \ + reverted-goodbye && + git rebase --skip && + test_path_is_missing .git/MERGE_MSG +' + test_expect_success 'correct advice upon picking empty commit' ' test_when_finished "git rebase --abort" && test_must_fail git rebase -i --onto goodbye \ diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh index e4cb8be0418..f23996c9be0 100755 --- a/t/t3418-rebase-continue.sh +++ b/t/t3418-rebase-continue.sh @@ -31,6 +31,16 @@ test_expect_success 'interactive rebase --continue works with touched file' ' git rebase --continue ' +test_expect_success 'rebase --continue removes .git/MERGE_MSG' ' + git checkout -f --detach topic && + + test_must_fail git rebase --onto main HEAD^ && + git read-tree --reset -u HEAD && + test_path_is_file .git/MERGE_MSG && + git rebase --continue && + test_path_is_missing .git/MERGE_MSG +' + test_expect_success 'non-interactive rebase --continue works with touched file' ' rm -fr .git/rebase-* && git reset --hard &&