From patchwork Tue Oct 23 19:57:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10653597 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 0EC9C13A9 for ; Tue, 23 Oct 2018 19:57:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F07A92A2B6 for ; Tue, 23 Oct 2018 19:57:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4DBF2A36C; Tue, 23 Oct 2018 19:57:19 +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 7FC3A2A2B6 for ; Tue, 23 Oct 2018 19:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727660AbeJXEWJ (ORCPT ); Wed, 24 Oct 2018 00:22:09 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40175 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725740AbeJXEWJ (ORCPT ); Wed, 24 Oct 2018 00:22:09 -0400 Received: by mail-pl1-f193.google.com with SMTP id b9-v6so801942pls.7 for ; Tue, 23 Oct 2018 12:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=6MlFu7BVWmuMQlEKaizfbmEkiBCeIo1J0q/3KuWk4Ys=; b=JLv8HWxwgZ5hbhC5NrTF/yqCRVh+sG8xUzJ3J3IlKEQh5jMIfatL1wrheyE9k1U1NJ pWbHR//KyaPVfyYbP8wM5a6p5YafRte8yREQlCgEN/BhRhIrsI6dnnwFwoT7urNZ0fqx jsVJ6GwXY87mdaWasYV/HrBpu9etTeGVznbDSsNc5Pb0o6AGGig+qvZGjpcRvbghcca9 jaWxsWIcsB3iTwZWl+nHHPXHDE63m/9UKHA2gltX9NsIEZjTX8nP/6D5U6JF1gln3Gt/ 0C9oDYRXOtNQReGdN6U1IVS75vRGuLLYxv3qR6J8HdLHr6y0/v1iq+/0sLcAzEKr7Af1 97Vw== 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:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=6MlFu7BVWmuMQlEKaizfbmEkiBCeIo1J0q/3KuWk4Ys=; b=iXn0j/xUFnDDQQJezsX3R75rkParYySJiXYaX3NEykNeAoNflbA3i/FUw8/kLNzxGT jie3JiPXXaWZe88Qh05yLSXHAlahdZ9GlRizd0yko8p+Xxj3IovqkwcIRr0jDNc3lb6x npfJpliYHYeDvwPDDmFUQ/dyTa18J1vusXGwrI/BYcHBX/JNucSecPlS9XaSdgMd1X/z V68IQfb6Wgumkg0Wgq6O26SZa5fJwpIE4Jk6eJvMljwh4ph8w3sYbTQtmd8D1ipa5JG2 GT4253VhR4w6LKqIu2rVYUDsU4x/pa5verhuZwjIldAJHQq0WAZxCAPPhpkwsUin05p7 oWqg== X-Gm-Message-State: ABuFfoi+YjckoJZmhQlpxgnidX17gpSdrksILt1xIvdjHu0FFLFxLofv WdzHGGFPYFe+GIeMu+2cxHcXqSkm X-Google-Smtp-Source: ACcGV62JNVh6jjMjrJQnU4tqtHrRIka7aKAtmApP4od4wnBLfcdmhhs1pHF1rKGbnmHmAbHw2iK7pg== X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr48717288plk.16.1540324637233; Tue, 23 Oct 2018 12:57:17 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id w63-v6sm2865372pgw.60.2018.10.23.12.57.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 12:57:16 -0700 (PDT) Date: Tue, 23 Oct 2018 12:57:16 -0700 (PDT) X-Google-Original-Date: Tue, 23 Oct 2018 19:57:11 GMT Message-Id: <6d9ff59733e632f69ff414baaaa084dfd461b7e1.1540324633.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 1/2] rebase --autostash: demonstrate a problem with dirty submodules Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin It has been reported that dirty submodules cause problems with the built-in rebase when it is asked to autostash. The symptom is: fatal: Unexpected stash response: '' This patch adds a regression test that demonstrates that bug. Original report: https://github.com/git-for-windows/git/issues/1820 Signed-off-by: Johannes Schindelin --- t/t3420-rebase-autostash.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh index 0c4eefec7..7eb9f9041 100755 --- a/t/t3420-rebase-autostash.sh +++ b/t/t3420-rebase-autostash.sh @@ -351,4 +351,14 @@ test_expect_success 'autostash is saved on editor failure with conflict' ' test_cmp expected file0 ' +test_expect_failure 'autostash with dirty submodules' ' + test_when_finished "git reset --hard && git checkout master" && + git checkout -b with-submodule && + git submodule add ./ sub && + test_tick && + git commit -m add-submodule && + echo changed >sub/file0 && + git rebase -i --autostash HEAD +' + test_done From patchwork Tue Oct 23 19:57:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Arver via GitGitGadget X-Patchwork-Id: 10653599 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 76E9D13A9 for ; Tue, 23 Oct 2018 19:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 632362A2B6 for ; Tue, 23 Oct 2018 19:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57B952A36C; Tue, 23 Oct 2018 19:57:21 +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 013422A2B6 for ; Tue, 23 Oct 2018 19:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727687AbeJXEWL (ORCPT ); Wed, 24 Oct 2018 00:22:11 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:36891 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725740AbeJXEWL (ORCPT ); Wed, 24 Oct 2018 00:22:11 -0400 Received: by mail-pl1-f195.google.com with SMTP id bh10-v6so1133122plb.4 for ; Tue, 23 Oct 2018 12:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:in-reply-to:references:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=NlVaPR/gHGRi69754meAVf2ZFOt/Rpb/mVfzHHadN7Q=; b=qofjrrKCYcdcfBe5lAXbtwPUybjVV9bGCbGam9HVVxg9MeuPnZP+eL+6aA3Y03s14M aUAQ9paJhJFpQlJNtapyCS6Ii/SNweOI1E37DzAd8YYWc1SrrioLYuahTz2TMIPj2WHo b6R/23jO5vncqZ6jEpK26ZRGhthaKchxx6HS/eiEWtYEJdy0iySHfvm1I1Wau5+QlRIb eYu8KCKBlPWBP1XuLgwk6iIMGoWs4GW1t6ZO9Po4LFCNaa5fzYqWDkA1uPdIoepnYAsl La4at195WbjLZPM7Ck9yNofMdUAhbloA3gBdWET5HEWkqquM08cWgR5q2S8L/9bjh6PA y/LA== 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:in-reply-to:references:from :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=NlVaPR/gHGRi69754meAVf2ZFOt/Rpb/mVfzHHadN7Q=; b=F4TwUF4j1XvQGNt9RETgEhq3+m0IXK/LViK/zkyjToICjRxRscPG4YoJQBftjYyv5A M26zWBixPnIiW8JQwMvKu519d2vpXm3lZof+3dwzY5erWTBu2OWLCk/t+R71zHbCjBf4 QOhqJckU0uveV5qrtkLap28sswNruxS4etHhiu0r47UqwjaTE5OSAPLv5ZaC01QC3qbe 7dBQT9vap02x3KpwskbUZbDnQVE3guDCLRr4PuKWopvS5LvwkDRU3bcddIyfvB2+Bh44 8Stw/gdfOfktRtmGebxzFKkBYV/O3HjtDG/A+G2KD9Yi/1xMlOQCVKJpfj5yHseRdgJt QFug== X-Gm-Message-State: ABuFfoh6AXy/WwVj8GhY3GfcWn+ikncb0P3wDC91AZQd8B8tPAiCqrOL RMMcr8pUT2ondHOe2bl8uySSUdA+ X-Google-Smtp-Source: ACcGV63Xx+IL8uZdMdKQB02Va1EePUQ7xll9c0kEvWtP2/2rVvcJ7RhajienSk9vkL6wJZy06Zt7Cw== X-Received: by 2002:a17:902:6ac7:: with SMTP id i7-v6mr50632064plt.268.1540324638629; Tue, 23 Oct 2018 12:57:18 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id k24-v6sm2582103pfi.11.2018.10.23.12.57.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 12:57:17 -0700 (PDT) Date: Tue, 23 Oct 2018 12:57:17 -0700 (PDT) X-Google-Original-Date: Tue, 23 Oct 2018 19:57:12 GMT Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 2/2] rebase --autostash: fix issue with dirty submodules Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano , Johannes Schindelin Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Schindelin Since we cannot stash dirty submodules, there is no use in requiring them to be clean (or stash them when they are not). This brings the built-in rebase in line with the previous, scripted version, which also did not care about dirty submodules (but it was admittedly not very easy to figure that out). This fixes https://github.com/git-for-windows/git/issues/1820 Signed-off-by: Johannes Schindelin --- builtin/rebase.c | 2 +- t/t3420-rebase-autostash.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/rebase.c b/builtin/rebase.c index 09f55bfb9..1dd24301f 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1349,7 +1349,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) update_index_if_able(&the_index, &lock_file); rollback_lock_file(&lock_file); - if (has_unstaged_changes(0) || has_uncommitted_changes(0)) { + if (has_unstaged_changes(1) || has_uncommitted_changes(1)) { const char *autostash = state_dir_path("autostash", &options); struct child_process stash = CHILD_PROCESS_INIT; diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh index 7eb9f9041..f355c6825 100755 --- a/t/t3420-rebase-autostash.sh +++ b/t/t3420-rebase-autostash.sh @@ -351,7 +351,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' ' test_cmp expected file0 ' -test_expect_failure 'autostash with dirty submodules' ' +test_expect_success 'autostash with dirty submodules' ' test_when_finished "git reset --hard && git checkout master" && git checkout -b with-submodule && git submodule add ./ sub &&