From patchwork Mon May 17 15:58:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262475 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=-15.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,USER_AGENT_GIT 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 5563BC433B4 for ; Mon, 17 May 2021 16:43:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C6A061059 for ; Mon, 17 May 2021 16:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239475AbhEQQoq (ORCPT ); Mon, 17 May 2021 12:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238203AbhEQQon (ORCPT ); Mon, 17 May 2021 12:44:43 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339F1C026CF8 for ; Mon, 17 May 2021 08:58:40 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id i22so9499964lfl.10 for ; Mon, 17 May 2021 08:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7dkgZsX2HyqQXzwicqV1ASn7xJG4Xe9wKAEfsARmcx0=; b=MqNCTh0yuTk0/E2KxRwll9aa0b7MLMZn1uA1/KWZbo3sLLmKEqwVWzus1SADlmqlRh BuVfaV5vEQvNR0HlD/mFTIOALDkKXh9eUxkuR8fBk96RmJf0DdOdEpb6BSSkA339XFVR T3HxVv+um3AEvUESTw9FVeHvfljaj6NgJnOMKPxw0v+9kA167DDrVafl+t1YMfIk1imy cKo6Phb1tszbh2vRjQfdiNzc8H313DkeSam52SdlNCIHlKaTFoJxB2j38LnN5ebcBgDH jCdox0mCBKGwzg8nVgopmnG9Vpqb2T+yStOJYYvoNBf3bq1Xll5Tap2wLDSaCvk56Dkt 86+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7dkgZsX2HyqQXzwicqV1ASn7xJG4Xe9wKAEfsARmcx0=; b=eQ5TEehUL6YvlnAotoUmcInWHaQcP5UPhFrn3wADji+akm5GVP937jSIDLQ9+7Bc8U 1pzjP+6E5geX4Ti6EOnysDzi17XMydqNSZ+bfZOGCMMfZZ2nq6Qpu/jGEGN7zmGg5yn1 49eD/WyQOJaol+IY26dIw+fpSDaOOQQI6erQLOwXi03GGfz6IAPKA70X9nR9MW4mqeos yapqvMYAfdH3/BcSTbXma+fTQvAGASSj2wi81BxaA542pFyJbr5ohLxYmSQmumkSvZx0 Tx90gxgCJwv3Twlp0cLx+gT5S9+4k+NMVlMzkjnGrCXihaGiiN5lRV2s5/rZcCevellK QBfg== X-Gm-Message-State: AOAM53163J82nv4Sl4zajGLd62VIf/T3zNZPET0YdSEBP5fq3T1PpSp1 /vswTxDJIdZpKreeAOvDdL8= X-Google-Smtp-Source: ABdhPJzCXiOE2zO5cs+OIWvJRX2Cp7GQmlnkekeJR2GXT/JDRnBLX6HyT6Kjp5x38TUJkPjC3h7mLA== X-Received: by 2002:a05:6512:1093:: with SMTP id j19mr401406lfg.508.1621267118790; Mon, 17 May 2021 08:58:38 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:38 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 1/9] t4013: test that "-m" alone has no effect in "git log" Date: Mon, 17 May 2021 18:58:10 +0300 Message-Id: <20210517155818.32224-2-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This is to notice current behavior that we are going to change when when we start to imply "-p" by "-m". Signed-off-by: Sergey Organov --- t/t4013-diff-various.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 87def81699bf..e9f67cd24351 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -452,6 +452,14 @@ diff-tree --stat --compact-summary initial mode diff-tree -R --stat --compact-summary initial mode EOF +test_expect_success 'log -m matches pure log' ' + git log master >result && + process_diffs result >expected && + git log -m >result && + process_diffs result >actual && + test_cmp expected actual +' + test_expect_success 'log --diff-merges=on matches --diff-merges=separate' ' git log -p --diff-merges=separate master >result && process_diffs result >expected && From patchwork Mon May 17 15:58:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262481 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=-15.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,USER_AGENT_GIT 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 93C71C433B4 for ; Mon, 17 May 2021 16:43:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77E9F610FA for ; Mon, 17 May 2021 16:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239607AbhEQQot (ORCPT ); Mon, 17 May 2021 12:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238338AbhEQQon (ORCPT ); Mon, 17 May 2021 12:44:43 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E8BAC026CF9 for ; Mon, 17 May 2021 08:58:41 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id i9so9532448lfe.13 for ; Mon, 17 May 2021 08:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nhQE+4C3s4dZyEuryZBTEMAFU+w/YgzcSN8Qkvty+LQ=; b=cbPHvo5hizp1u48ElMGV+VT/niCAGFQyeFJc52czaKhR+cM2auyasXF9nlQz3eJflh ouTJAWJr0vlkZuqwu1qqrKmjaTSuDwqCYsLEvHa+ShW9UrMaL//tJH5yvD3a1L3QgtFN ld3zhHZ4YtoDxELL9jUxEV7rQ0e//3nzPvTYN+oAj0dpG8glHK6cn9pU62FCO9TzzoUJ 10TfGLYAmVLoHrG91dJ8GWeFHIwhWY+AycDBU2nMleWzcav/konxK+hpAEwLzANpIXK0 +wt9or6fLk8zIDByml838Hd4L31GkzfDzr19LUdh8QszeYJzbqA0aWK+PNdwbWWYyEGS pJhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nhQE+4C3s4dZyEuryZBTEMAFU+w/YgzcSN8Qkvty+LQ=; b=G62lO3Qy1UwYYsxb9VjXtBjRsVtG5EuJAEC9oFnyt2LBJP4m61OybRg/ZBC5OZVvXO up72NyM8qAOOcBnH5s8usj6PVtujUPqvY10m8YTwGZLM3sAU/FgLDRPG7SYCVQxieSj0 xRuABEJVgf02HYQulnbqvQhQ6UXfJwISZc/73tRg+NpfYKbHrnABhzFK4TBwNXT+4vBB KPqeg1rV5erBFJ+ErikDohiIlcFMXREW3NNwKUzPbH+nt2jYZKOjksYmyLomOkGxfxyj acOEU9fwO9/V+59N4tOxSsVFwe7KiLZdnfnM5dDIsHFjSKJn1rdFjHepndg/6iGjokvg 3qyw== X-Gm-Message-State: AOAM532kv2UtgZ8XImA15cJMmtnVoBbdVssYpmVl7M434I7uDaogBT9q rwHf0b6lCg+vDZ8mrBpK+QU= X-Google-Smtp-Source: ABdhPJwuAdmAKkZV4GERLHt0EbTxKYTnqNpd5OHrJGBryNOEXfb2bqASEryNfghMGK1WC5Xxag94JA== X-Received: by 2002:ac2:515b:: with SMTP id q27mr410907lfd.224.1621267119872; Mon, 17 May 2021 08:58:39 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:39 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 2/9] t4013: test "git -m --raw" Date: Mon, 17 May 2021 18:58:11 +0300 Message-Id: <20210517155818.32224-3-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This is to ensure we won't break different diff formats when we start to imply "-p" by "-m". Signed-off-by: Sergey Organov --- t/t4013-diff-various.sh | 1 + t/t4013/diff.log_-m_--raw_master | 61 ++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 t/t4013/diff.log_-m_--raw_master diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index e9f67cd24351..1809355f9bb1 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -337,6 +337,7 @@ log -m -p --first-parent master log -m -p master log --cc -m -p master log -c -m -p master +log -m --raw master log -SF master log -S F master log -SF -p master diff --git a/t/t4013/diff.log_-m_--raw_master b/t/t4013/diff.log_-m_--raw_master new file mode 100644 index 000000000000..cd2ecc462832 --- /dev/null +++ b/t/t4013/diff.log_-m_--raw_master @@ -0,0 +1,61 @@ +$ git log -m --raw master +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (from 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0) +Merge: 9a6d494 c7a2ab9 +Author: A U Thor +Date: Mon Jun 26 00:04:00 2006 +0000 + + Merge branch 'side' + +:100644 100644 cead32e... 992913c... M dir/sub +:100644 100644 b414108... 10a8a9f... M file0 + +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (from c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a) +Merge: 9a6d494 c7a2ab9 +Author: A U Thor +Date: Mon Jun 26 00:04:00 2006 +0000 + + Merge branch 'side' + +:100644 100644 7289e35... 992913c... M dir/sub +:100644 100644 f4615da... 10a8a9f... M file0 +:000000 100644 0000000... b1e6722... A file1 +:100644 000000 01e79c3... 0000000... D file2 +:100644 000000 7289e35... 0000000... D file3 + +commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a +Author: A U Thor +Date: Mon Jun 26 00:03:00 2006 +0000 + + Side + +:100644 100644 35d242b... 7289e35... M dir/sub +:100644 100644 01e79c3... f4615da... M file0 +:000000 100644 0000000... 7289e35... A file3 + +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 +Author: A U Thor +Date: Mon Jun 26 00:02:00 2006 +0000 + + Third + +:100644 100644 8422d40... cead32e... M dir/sub +:000000 100644 0000000... b1e6722... A file1 + +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 +Author: A U Thor +Date: Mon Jun 26 00:01:00 2006 +0000 + + Second + + This is the second commit. + +:100644 100644 35d242b... 8422d40... M dir/sub +:100644 100644 01e79c3... b414108... M file0 +:100644 000000 01e79c3... 0000000... D file2 + +commit 444ac553ac7612cc88969031b02b3767fb8a353a +Author: A U Thor +Date: Mon Jun 26 00:00:00 2006 +0000 + + Initial +$ From patchwork Mon May 17 15:58:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262479 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=-15.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,USER_AGENT_GIT 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 3D77DC43470 for ; Mon, 17 May 2021 16:43:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2378961184 for ; Mon, 17 May 2021 16:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239597AbhEQQos (ORCPT ); Mon, 17 May 2021 12:44:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238356AbhEQQoo (ORCPT ); Mon, 17 May 2021 12:44:44 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5884FC026CFB for ; Mon, 17 May 2021 08:58:42 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id r5so9567888lfr.5 for ; Mon, 17 May 2021 08:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HvGN4I9Mq2UfuOMTLnmwVYNfl7ipfkTomAHZoFPm8cE=; b=lkZfZ4GYsUp+lT5f3GuRPT1QUKkJ2RfSEaBQacUgWrcKXltUs8PZ6fMTH9ESQ6tMGC GGxxs66eIMGl5yhwCbW0aqXOAUCEhcVzputwjZm7hRk9eNzBLVt4QDlaOaiqFdCZRt+G LlcP25yzMiUItJSCCxjnEX6Q35wO9Mb5jtXZMelqrwXkdaBBPzlcX9r0rFH1o3bWO+Pu fu2/ASyMWUouk9GRqtb2IWUiHuAh6nb9+9wNtUmBo9qGUduWp3PXc7gwkCKx30VzDVpq PrXJ0+l1kewkiRxqcN1CdGxI1dW9QdtlmnsP8K18BEx7++vmEs+TQChz/l2weB1vH/Ph Wk0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HvGN4I9Mq2UfuOMTLnmwVYNfl7ipfkTomAHZoFPm8cE=; b=eSRGdLLSBnWO5kJSFK5crt8M+k67LdvG7DKhYq//nViFS54I76n7mQKtWa0Pd131hx GgGr6jWySK0eJ0oPhJMFunjeUSHWzJFInWB31F4sYr18amvS6t2HorUfWxBN0NvCWpEx 0HMNpi815UZSiDqabQBgkKZhaFfUzKh+kc/wDV/vNzDN16RpCDv8NXh/ZpHDrPAsqefh +7dfZzuEK6DQU1nChYacwm5NbHOFImUNtWOZ08pTwBfUhM7Yvy8Ea8r4QYplvEMmLgcp IIbNqDffNQRSawJI2fjo47K25wWOQjlqgdZpyH6XXyVvtuPhCaqRVQ2Z/mskYnIKvzbS nDUw== X-Gm-Message-State: AOAM532faxZf15Wr3M74JRXyZL224hBvaahaAqJ6KgnbP54ayjH2ncTw Xq9+VhZvX8TqX5dE2imn9bM= X-Google-Smtp-Source: ABdhPJwKv1jgXiasWm5hpd7sB/UUJvLbhDYPvrSMWafnjGfnrUMjuzaG1eRO8ywIW3zpZ9QZZCG3jA== X-Received: by 2002:a05:6512:acf:: with SMTP id n15mr379970lfu.518.1621267120910; Mon, 17 May 2021 08:58:40 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:40 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 3/9] t4013: test "git -m --stat" Date: Mon, 17 May 2021 18:58:12 +0300 Message-Id: <20210517155818.32224-4-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This is to ensure we won't break different diff formats when we start to imply "-p" by "-m". Signed-off-by: Sergey Organov --- t/t4013-diff-various.sh | 1 + t/t4013/diff.log_-m_--stat_master | 66 +++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 t/t4013/diff.log_-m_--stat_master diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 1809355f9bb1..e53ca7aa503f 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -338,6 +338,7 @@ log -m -p master log --cc -m -p master log -c -m -p master log -m --raw master +log -m --stat master log -SF master log -S F master log -SF -p master diff --git a/t/t4013/diff.log_-m_--stat_master b/t/t4013/diff.log_-m_--stat_master new file mode 100644 index 000000000000..c7db084fd905 --- /dev/null +++ b/t/t4013/diff.log_-m_--stat_master @@ -0,0 +1,66 @@ +$ git log -m --stat master +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (from 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0) +Merge: 9a6d494 c7a2ab9 +Author: A U Thor +Date: Mon Jun 26 00:04:00 2006 +0000 + + Merge branch 'side' + + dir/sub | 2 ++ + file0 | 3 +++ + 2 files changed, 5 insertions(+) + +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 (from c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a) +Merge: 9a6d494 c7a2ab9 +Author: A U Thor +Date: Mon Jun 26 00:04:00 2006 +0000 + + Merge branch 'side' + + dir/sub | 4 ++++ + file0 | 3 +++ + file1 | 3 +++ + file2 | 3 --- + file3 | 4 ---- + 5 files changed, 10 insertions(+), 7 deletions(-) + +commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a +Author: A U Thor +Date: Mon Jun 26 00:03:00 2006 +0000 + + Side + + dir/sub | 2 ++ + file0 | 3 +++ + file3 | 4 ++++ + 3 files changed, 9 insertions(+) + +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 +Author: A U Thor +Date: Mon Jun 26 00:02:00 2006 +0000 + + Third + + dir/sub | 2 ++ + file1 | 3 +++ + 2 files changed, 5 insertions(+) + +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 +Author: A U Thor +Date: Mon Jun 26 00:01:00 2006 +0000 + + Second + + This is the second commit. + + dir/sub | 2 ++ + file0 | 3 +++ + file2 | 3 --- + 3 files changed, 5 insertions(+), 3 deletions(-) + +commit 444ac553ac7612cc88969031b02b3767fb8a353a +Author: A U Thor +Date: Mon Jun 26 00:00:00 2006 +0000 + + Initial +$ From patchwork Mon May 17 15:58:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262477 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=-15.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,USER_AGENT_GIT 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 1CE1FC43461 for ; Mon, 17 May 2021 16:43:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 014E4611B0 for ; Mon, 17 May 2021 16:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238021AbhEQQor (ORCPT ); Mon, 17 May 2021 12:44:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238603AbhEQQoo (ORCPT ); Mon, 17 May 2021 12:44:44 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4862EC026CFC for ; Mon, 17 May 2021 08:58:43 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id v6so7875039ljj.5 for ; Mon, 17 May 2021 08:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=05utSWV2L/QiUJh2+Jr8LiKrgu2RAKe6xUFhGGiDPWs=; b=j4AHLKXEmhXs0tmlcL8DZOcRRRZmy+ClYBsX054nl/lyFiNF1qBk3DsAv5WjwhA/uM tRVa8b97Kh5mFAYOdnUEs5DVPEHjmE8S+FdNXE5FmAMKcs4/CYQeye9i3FnBKQ50otLD ac9xCln0IaBF5q9Tuz2e+YQHS8KvEJPtQ+RQlmqxg4GgpHkg7877SNEXNzf4xnp9G1K1 MNLOmZXq4f3jGtSvRDXX52Wd11jD0Lfm+4f+DUek/UALPxw8tmYYjomB8wgeNoK1puLL vLAO6ggZZt4kohzHL42t+M6PWLSQfQs1XP5Exb4rLFjnb9rRqcPfVbxx+AnLtaWeTBnF XLOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=05utSWV2L/QiUJh2+Jr8LiKrgu2RAKe6xUFhGGiDPWs=; b=W0YLLcwMmmZOF6WOlKPJawKfpe4rCq41xof5EN7FjvvGMyGZ5CM1/cY4e4QdkuNxw+ 0yoq6a4V6r2TGrzfA4jLaseKZ4ydI2XKOTz2UStxZ1TgKxlkWMzcarPogH8z9frU1HA4 XIKGf2aN5asLn/uBDs807gpOR7CrPms5e1U3evcIIXxWBUGLW3zVCvOMMa34/U1EsAaB HD2ebKOziF+mZYs8cdlR39kdO8jLAy+//P6lbndVCbbOP/mApk8ibZMoGHPWYUHLuZSf WldGP7kWVnJs12r9odmgo6FXlShVxyoALNEQQ1t8b2ph0mZlQLKoCroTSiwfR2vuaV39 lQzQ== X-Gm-Message-State: AOAM532O2r+OhfNlJ12ULujjKHXDTkw60Pc5Y8b9vQX2XQZKDNr9DV2e eV8M7X+UHNoweYdTJ5YjIfc= X-Google-Smtp-Source: ABdhPJxSI47H26h2Gx6M6uoXMJ9u5PDaWlVX49MKgOKUvhCoxcKEJw1QfuTJVOO7WThLP42/42oqhQ== X-Received: by 2002:a2e:9615:: with SMTP id v21mr128438ljh.184.1621267121871; Mon, 17 May 2021 08:58:41 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:41 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 4/9] t4013: test "git diff-index -m" Date: Mon, 17 May 2021 18:58:13 +0300 Message-Id: <20210517155818.32224-5-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org -m in "git diff-index" means "match missing", that differs from its meaning in "git diff". Let's check it in diff-index. Signed-off-by: Sergey Organov --- t/t4013-diff-various.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index e53ca7aa503f..c35cc73d08bd 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -493,6 +493,19 @@ test_expect_success 'git config log.diffMerges first-parent vs -m' ' test_cmp expected actual ' +# -m in "git diff-index" means "match missing", that differs +# from its meaning in "git diff". Let's check it in diff-index. +# The line in the output for removed file should disappear when +# we provide -m in diff-index. +test_expect_success 'git diff-index -m' ' + rm -f file1 && + git diff-index HEAD >without-m && + lines_count=$(wc -l with-m && + git restore file1 && + test_line_count = $((lines_count - 1)) with-m +' + test_expect_success 'log -S requires an argument' ' test_must_fail git log -S ' From patchwork Mon May 17 15:58:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262489 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=-15.8 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,USER_AGENT_GIT 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 64C7BC433B4 for ; Mon, 17 May 2021 16:43:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44C4861059 for ; Mon, 17 May 2021 16:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239921AbhEQQpC (ORCPT ); Mon, 17 May 2021 12:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236000AbhEQQop (ORCPT ); Mon, 17 May 2021 12:44:45 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CDF6C0AF560 for ; Mon, 17 May 2021 08:58:44 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id b12so633283ljp.1 for ; Mon, 17 May 2021 08:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q5WLGyQxJ+bSbUwGFcCKinvSLjoeHjsRBqjWo58Znlc=; b=oV0nYEdgsPAo8O7yyHTzuj3k/mrG8hRmgqmvoWgO06+2iV7Ch/jYd4QBLlyEp85ngx mPA0jWdXgOHQbT5l5Qoimvh3wRmD7ZYCGTvSagOBXvqjPY+j2WiGLibXKNWZVkOfoHhd WTMIiCRBgWeEpppJK/a5apVHeVdW4N5t+IPmpscQNJ4dSTSO5FWwpF5T8xbDbvqnAHHd CiF3p/yGd5vR9HbeWlorGwMBivUJNyMhzsF9GQ1wBMse5aJG3YVAyRaDmsOaMpPQOynP YoWZEuaoG4RYkGLjQ+pkKh372/koRASz3TR1EJWktLgsIxSR+Vq34rDjo1W65zNrTJWl wcMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q5WLGyQxJ+bSbUwGFcCKinvSLjoeHjsRBqjWo58Znlc=; b=UMCwHNIabO2GUMp309rqQBZJ3y32w0tRRo7HajH0zVPi3/uvP3m6pOqXcdesP8TNSR DsYnLrLO1OWUqd+JoqyGiVSA5Ph8WUw2LDN4K1VdcdoXlVkS/FrjcmaZXiTDuTNg6yPw L4UAM6ccYWpmD0z0OySKvSxYChRx2xq8ImaGyG80vG6vZRDP204j4ysbROQ76yxsQhVH PWh45qIGW0tcB1+UD6dYHNaXxWmAabDmSbJugw6qYKC3SpCYj7jHm7MpHbsO0tgjlIHj YMclyd/WxEof+PKFyDqA8uLleYNPx4qtuBGHlWzFltfgx33mgO5XXjjrkyjBYjDjKl3Q gNwA== X-Gm-Message-State: AOAM530vZ39gFFYwz352X4lUR6IPIwoasj3gYgcN7w+dQh8Ha4kSL07O 4uiSUPI0VGo1L13iVGzimHw= X-Google-Smtp-Source: ABdhPJzvqEyYzFrK8bb8auADr9rHhJ9wc1qQqEx0h0DLagzZF7TYfCKHM0wiXONNim8Ye/zjuDtW0Q== X-Received: by 2002:a2e:a379:: with SMTP id i25mr92484ljn.365.1621267122812; Mon, 17 May 2021 08:58:42 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:42 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 5/9] diff-merges: move specific diff-index "-m" handling to diff-index Date: Mon, 17 May 2021 18:58:14 +0300 Message-Id: <20210517155818.32224-6-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Move specific handling of "-m" for diff-index to diff-index.c, so diff-merges is left to handle only diff for merges options. Being a better design by itself, this is especially essential in preparation for letting -m imply -p, as "diff-index -m" obviously should not imply -p, as it's entirely unrelated. To handle this, in addition to moving specific diff-index "-m" code out of diff-merges, we introduce new diff_merges_suppress_options_parsing() and call it before generic options processing in cmd_diff_index(). This new diff_merges_suppress_options_parsing() could then be reused and called before invocations of setup_revisions() for other commands that don't need --diff-merges options, but that's outside of the scope of these patch series. Signed-off-by: Sergey Organov --- builtin/diff-index.c | 9 +++++++++ diff-merges.c | 25 +++++++++++++------------ diff-merges.h | 2 ++ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/builtin/diff-index.c b/builtin/diff-index.c index 176fe7ff2b4e..cf09559e422d 100644 --- a/builtin/diff-index.c +++ b/builtin/diff-index.c @@ -2,6 +2,7 @@ #include "cache.h" #include "config.h" #include "diff.h" +#include "diff-merges.h" #include "commit.h" #include "revision.h" #include "builtin.h" @@ -27,6 +28,12 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix) rev.abbrev = 0; prefix = precompose_argv_prefix(argc, argv, prefix); + /* + * We need no diff for merges options, and we need to avoid conflict + * with our own meaning of "-m". + */ + diff_merges_suppress_options_parsing(); + argc = setup_revisions(argc, argv, &rev, NULL); for (i = 1; i < argc; i++) { const char *arg = argv[i]; @@ -35,6 +42,8 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix) option |= DIFF_INDEX_CACHED; else if (!strcmp(arg, "--merge-base")) option |= DIFF_INDEX_MERGE_BASE; + else if (!strcmp(arg, "-m")) + rev.match_missing = 1; else usage(diff_cache_usage); } diff --git a/diff-merges.c b/diff-merges.c index f3a9daed7e05..9ca00cdd0cc6 100644 --- a/diff-merges.c +++ b/diff-merges.c @@ -6,6 +6,7 @@ typedef void (*diff_merges_setup_func_t)(struct rev_info *); static void set_separate(struct rev_info *revs); static diff_merges_setup_func_t set_to_default = set_separate; +static int suppress_parsing; static void suppress(struct rev_info *revs) { @@ -30,17 +31,6 @@ static void set_first_parent(struct rev_info *revs) revs->first_parent_merges = 1; } -static void set_m(struct rev_info *revs) -{ - /* - * To "diff-index", "-m" means "match missing", and to the "log" - * family of commands, it means "show default diff for merges". Set - * both fields appropriately. - */ - set_to_default(revs); - revs->match_missing = 1; -} - static void set_combined(struct rev_info *revs) { suppress(revs); @@ -101,14 +91,22 @@ int diff_merges_config(const char *value) return 0; } +void diff_merges_suppress_options_parsing(void) +{ + suppress_parsing = 1; +} + int diff_merges_parse_opts(struct rev_info *revs, const char **argv) { int argcount = 1; const char *optarg; const char *arg = argv[0]; + if (suppress_parsing) + return 0; + if (!strcmp(arg, "-m")) { - set_m(revs); + set_to_default(revs); } else if (!strcmp(arg, "-c")) { set_combined(revs); revs->combined_imply_patch = 1; @@ -155,6 +153,9 @@ void diff_merges_set_dense_combined_if_unset(struct rev_info *revs) void diff_merges_setup_revs(struct rev_info *revs) { + if (suppress_parsing) + return; + if (revs->combine_merges == 0) revs->dense_combined_merges = 0; if (revs->separate_merges == 0) diff --git a/diff-merges.h b/diff-merges.h index 09d9a6c9a4fb..b5d57f6563e3 100644 --- a/diff-merges.h +++ b/diff-merges.h @@ -11,6 +11,8 @@ struct rev_info; int diff_merges_config(const char *value); +void diff_merges_suppress_options_parsing(void); + int diff_merges_parse_opts(struct rev_info *revs, const char **argv); void diff_merges_suppress(struct rev_info *revs); From patchwork Mon May 17 15:58:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262485 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=-15.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,USER_AGENT_GIT 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 A7072C43460 for ; Mon, 17 May 2021 16:43:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84C9661059 for ; Mon, 17 May 2021 16:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239017AbhEQQo4 (ORCPT ); Mon, 17 May 2021 12:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238799AbhEQQoo (ORCPT ); Mon, 17 May 2021 12:44:44 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BD3CC0AF561 for ; Mon, 17 May 2021 08:58:45 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id p20so7860317ljj.8 for ; Mon, 17 May 2021 08:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0OfjDCFK40CHYWc5u5uSaXiZBcYaZsJ1ZH5HBXLLJ+Y=; b=ufjR+iPGgYbF9XLoQ9os3K8efHcFbek5e6rDZUvVlQkoWdVtRSdwx1NMscxuIoxkR5 A76FkZTeeKDXgeMxLdg/eR3wKBEkrrsdqm0+lVuPK4na/JGsnyT8d2lZXwr+KvQg5IF0 hpVShE1fwsAOs73BaBGJirbdbPh1zD4hHVTOFLjNxEhxrXxQIYl7rxLjF8kP7AS2tqf0 e01LVebqySpqly7Nyno2xMPA1vYxhUsngNEwRal1zBw34fCBTTZpE/HbmfzSAALtO+4f mP54g+WhVLeAK6VyJDqkwSM6gqQ0rwpcyhP3dlk7FhcGd53bmL7vwTBXnLxg+FBW72RN QwvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0OfjDCFK40CHYWc5u5uSaXiZBcYaZsJ1ZH5HBXLLJ+Y=; b=C23k0qX4i3i9SNZB6/EGPPr5DjvkqgZv3UjGXiN5e+ixiUnrtTNOsd6bYyGIkgbNGC SX04MgQmMdJ6RnBi8ZEIyVCQItGfXHF7o/0QAGc6p9VJKzwPAfogMW33IpxWRUI4IYnm td4Jas9OpA0O9CgfVqV8UJYX2BOceLsP5wTH+bwC7JyW3aw9BONqgYacq/FpnEIdS/4P 6E2Wk5nuoRTlo1MB1GyrsNI3c7fAvHJNuf5bH3oppvcew0aILGJB3BkoMaLpmoUBNGaN 3xP6/rrMRLmBfkPZJR1Hfv//mNrd7MAkjklIULnzjwTw1HABekuhfypqOrBwKo00040+ 9vWA== X-Gm-Message-State: AOAM531y1yn4ABc+BrCbmJLqn3ddEYVJ5mht8vUoBAdWQ+wwIva9bqbR aCD6ynNx3SIxCu/Vs5fWGTA= X-Google-Smtp-Source: ABdhPJyzJteJP83FGbSG+GAQgTl3tqsDTebWUklNaJk8BRzuMNFpAQuWtFWRN+1svPb3iyUdGBmZqw== X-Received: by 2002:a2e:82c5:: with SMTP id n5mr99311ljh.191.1621267123897; Mon, 17 May 2021 08:58:43 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:43 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 6/9] git-svn: stop passing "-m" to "git rev-list" Date: Mon, 17 May 2021 18:58:15 +0300 Message-Id: <20210517155818.32224-7-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org rev-list doesn't utilize -m. It happens to eat it silently, so this bug went unnoticed. Signed-off-by: Sergey Organov --- perl/Git/SVN.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm index f6f1dc03c608..35ff5a68963d 100644 --- a/perl/Git/SVN.pm +++ b/perl/Git/SVN.pm @@ -1636,7 +1636,7 @@ sub has_no_changes { my $commit = shift; my @revs = split / /, command_oneline( - qw(rev-list --parents -1 -m), $commit); + qw(rev-list --parents -1), $commit); # Commits with no parents, e.g. the start of a partial branch, # have changes by definition. From patchwork Mon May 17 15:58:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262493 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=-15.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,USER_AGENT_GIT 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 5C0D8C433ED for ; Mon, 17 May 2021 16:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 417E361059 for ; Mon, 17 May 2021 16:43:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237170AbhEQQpH (ORCPT ); Mon, 17 May 2021 12:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238970AbhEQQop (ORCPT ); Mon, 17 May 2021 12:44:45 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E309C0AF563 for ; Mon, 17 May 2021 08:58:46 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id q7so8235904lfr.6 for ; Mon, 17 May 2021 08:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GAK0Kmgdeu2Z6za0hohy+9fZwSEjprYEppbMV+tguz4=; b=P+dnRJvqmo0G9d6ouG6dMzX2ahwuke82E0AAIo/fiOHaPpxrOiimu6KVcLUUd2pLuu UDuBwXGNI15VkukoYwuyV+SjTPPBXerdDj8ePir5oM+L6T4VUnE+5ndBgF9T16DHrn8u 4SHEG8IMK+bBr1arKVbnVoZF0KmVzy7yqpmEWIG8Cec8h0GE7CVnm1352aRsOzHnG3Om 0Od2s46n9JBL4OhM5XCc3xyDQY024hKI8KRq6vGerBAZDzKygBJjUfm+NvzVE033rhz5 YExXsKMmM3tV4fM5gx4vefgl/uSdyEg9Nw39cRuqPOi+haoNT2iYpVUOojZBrpAEMQX7 VXOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GAK0Kmgdeu2Z6za0hohy+9fZwSEjprYEppbMV+tguz4=; b=QUU4Qq9klRtYBV+n3DEjBdqL82oadODLhw/kzV/i+NnpVofbMpI4VgmG1+hqwW3LjM odZA6PlfTf6x+HpM0B5U2+dfvBkesUnFrxVrxCfVdYgZDMtP+cv4rwPqrS2MBqjYGNCk yOKKdIgaUchlXSDezd0Eroeu0flv3jZd8bgI0AFPMM0+UdqxjwFx7mSjw6XmCOqmJFvR GmPc9Ur0aVlk+fT4HJfA9lTTZ30Bccx1lyFXVbZBHyB/c1gLSxsvoDaqJjkgHF7nma3Z u4UGG7uY8h1njFLBLm3w8x7DTnmu29Fby/xg7ezAgvvIncMxICAVLxqykMwV7b6071lv vpjg== X-Gm-Message-State: AOAM532lURR8WmqpSPdyjAo1FMHoM/fCks3+VFGo64arCF1EmNgijtda LLDzSSh250D9ZKGzoMQdXbo= X-Google-Smtp-Source: ABdhPJyh+RiHAUoj3PTjIjE2VVijcQKCO+4DVBhbxFG5Ym2V9jXMDPqQHiEwaPj5509zw8nvRc9atA== X-Received: by 2002:a05:6512:3b87:: with SMTP id g7mr380195lfv.241.1621267125080; Mon, 17 May 2021 08:58:45 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:44 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 7/9] stash list: stop passing "-m" to "git list" Date: Mon, 17 May 2021 18:58:16 +0300 Message-Id: <20210517155818.32224-8-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Passing "-m" in "git list --first-parent -m" is not needed as --first-parent implies --diff-merges=first-parent anyway. OTOH, it will stop being harmless once we let "-m" imply "-p". While we are at it, fix corresponding test description in t3903-stash to match what it actually tests. Signed-off-by: Sergey Organov --- builtin/stash.c | 2 +- t/t3903-stash.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index d68ed784d2af..fe8e97428808 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -761,7 +761,7 @@ static int list_stash(int argc, const char **argv, const char *prefix) cp.git_cmd = 1; strvec_pushl(&cp.args, "log", "--format=%gd: %gs", "-g", - "--first-parent", "-m", NULL); + "--first-parent", NULL); strvec_pushv(&cp.args, argv); strvec_push(&cp.args, ref_stash); strvec_push(&cp.args, "--"); diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 5f282ecf6175..873aa56e359d 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -859,7 +859,7 @@ test_expect_success 'setup stash with index and worktree changes' ' git stash ' -test_expect_success 'stash list implies --first-parent -m' ' +test_expect_success 'stash list -p shows simple diff' ' cat >expect <<-EOF && stash@{0} From patchwork Mon May 17 15:58:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262487 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=-15.8 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,USER_AGENT_GIT 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 64976C433ED for ; Mon, 17 May 2021 16:43:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 42A7C610FA for ; Mon, 17 May 2021 16:43:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239908AbhEQQo7 (ORCPT ); Mon, 17 May 2021 12:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238807AbhEQQoo (ORCPT ); Mon, 17 May 2021 12:44:44 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FF49C0AF564 for ; Mon, 17 May 2021 08:58:47 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id w15so7850477ljo.10 for ; Mon, 17 May 2021 08:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v7LjQ1nCHmH3DD5i6uodYrBsR+g7A7XW0vpjyrg6Y0E=; b=N140lRcSWigYCgQCXC/CuDs9t3ffWXB35Mrj+eyCsjRw1zD3yZ071/R3n4NRHHHnmn lfn3/f7gEGG5JzeOjtVavAskzOa/NoDAdSoSQjRkENNEeCKw4iKgpPJ/P+dipQPBKHOb TvLu8u2ur07qJhZAWzsQb4gEQOyuPFNGHrTuvs7KJ9uyrugGf/HNVqovy58x1QPJF7NU OGW+AFB2cmaeeuhvNpsE7Eh3ptMJuwwvQ/g5UV0Q6QtsnRuy7nA41Tx+xkqw7aan2vU3 HkmCNQNGKxCRpX9FTPPD7vGm54GY97OCxhiCwyPHPE+GTCdz99T1gUPjlfXhfINaJsXD MD1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v7LjQ1nCHmH3DD5i6uodYrBsR+g7A7XW0vpjyrg6Y0E=; b=sjWRzTM+dNWd2TpUYEltHHpo0XYY/2Wy1dES0rvZhglF95mkFJj7xsrea+cjcmQbEF cufrlDNJQuWWHnTRQZrrw8maZwoowRWSb91WqUH9Xc4Gl/vt/tjBQiSA/QxgeDVa/G1w WKJWaxzrit7rp6UVr5nbcuXqw+yh4aQrJKiuWNbyQgBMj28W8AtWB/IaFZcj2D/uvmEC 9VXZyIZfx0jXDUBSrS8LrbD9evyqXd2JfAROTmkOcsZPOLbkR4uYj191k9O67kWCPKfF Gj67APv5AU7AkzCFlapCDMofQ4Pw8N6u2Swo4flfk6GKY7YgUdp77dTZbKYLf+GsIhk6 isQg== X-Gm-Message-State: AOAM5325OBgT6gPM79gK2hlBMk960lxif/SgjqRxIHKO8NkKhYIKZcAI CZ2JoHUv5VawIJxKHCM9ECI= X-Google-Smtp-Source: ABdhPJyfAnlwwQfeWZtRiuLwvCTomlj6qoX6WmJSDzQRSeWnz9S/csAftD4birxLtXUjnmdJPhgAMw== X-Received: by 2002:a2e:80cf:: with SMTP id r15mr91099ljg.409.1621267126159; Mon, 17 May 2021 08:58:46 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:45 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 8/9] diff-merges: rename "combined_imply_patch" to "merges_imply_patch" Date: Mon, 17 May 2021 18:58:17 +0300 Message-Id: <20210517155818.32224-9-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This is refactoring change in preparation for the next commit that will let -m imply -p. The old name doesn't match the intention to let not only -c/-cc imply -p, but also -m, that is not a "combined" format, so we rename the flag accordingly. Signed-off-by: Sergey Organov --- diff-merges.c | 10 +++++----- revision.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/diff-merges.c b/diff-merges.c index 9ca00cdd0cc6..d897fd8a2933 100644 --- a/diff-merges.c +++ b/diff-merges.c @@ -15,7 +15,7 @@ static void suppress(struct rev_info *revs) revs->combine_merges = 0; revs->dense_combined_merges = 0; revs->combined_all_paths = 0; - revs->combined_imply_patch = 0; + revs->merges_imply_patch = 0; revs->merges_need_diff = 0; } @@ -109,10 +109,10 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv) set_to_default(revs); } else if (!strcmp(arg, "-c")) { set_combined(revs); - revs->combined_imply_patch = 1; + revs->merges_imply_patch = 1; } else if (!strcmp(arg, "--cc")) { set_dense_combined(revs); - revs->combined_imply_patch = 1; + revs->merges_imply_patch = 1; } else if (!strcmp(arg, "--no-diff-merges")) { suppress(revs); } else if (!strcmp(arg, "--combined-all-paths")) { @@ -162,9 +162,9 @@ void diff_merges_setup_revs(struct rev_info *revs) revs->first_parent_merges = 0; if (revs->combined_all_paths && !revs->combine_merges) die("--combined-all-paths makes no sense without -c or --cc"); - if (revs->combined_imply_patch) + if (revs->merges_imply_patch) revs->diff = 1; - if (revs->combined_imply_patch || revs->merges_need_diff) { + if (revs->merges_imply_patch || revs->merges_need_diff) { if (!revs->diffopt.output_format) revs->diffopt.output_format = DIFF_FORMAT_PATCH; } diff --git a/revision.h b/revision.h index 93aa012f518e..17698cb51aca 100644 --- a/revision.h +++ b/revision.h @@ -193,10 +193,10 @@ struct rev_info { /* Diff-merge flags */ explicit_diff_merges: 1, merges_need_diff: 1, + merges_imply_patch:1, separate_merges: 1, combine_merges:1, combined_all_paths:1, - combined_imply_patch:1, dense_combined_merges:1, first_parent_merges:1; From patchwork Mon May 17 15:58:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 12262491 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=-15.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,USER_AGENT_GIT 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 CF588C43460 for ; Mon, 17 May 2021 16:43:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3C5661059 for ; Mon, 17 May 2021 16:43:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236787AbhEQQpF (ORCPT ); Mon, 17 May 2021 12:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238848AbhEQQop (ORCPT ); Mon, 17 May 2021 12:44:45 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63655C0AF565 for ; Mon, 17 May 2021 08:58:49 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id w33so1607210lfu.7 for ; Mon, 17 May 2021 08:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GMLD7fM0sXSygPEEn1GQHrpSr0o3MxgtlVk9jtYim58=; b=I/jnxyDGbI6phBjZgjGdG8PPgFcvsyFR6GLi5lHFNFSaDLiySYwruuTp/UCqXTRed7 6xz9ROWGptLOSvwiFSQ//DX6hiOuwV6I/jdDus6Spam1KPnPBC57n8eeWp+ATpT3vQ7Z n0DAbFc2Xv+kv5okVvhXjmgyg53ZxcC/+JNDRGrCX4A9nGo5W6Oc+9Fw/wINfzkXm2e2 ueDZRchMGhYFnjn8HZFCcOmYe4hqSjamLs1N2Hbc5nO/tZdqO3SgRsS2f8IdiNhCejAb 1a/fEob1d1lK2IYBT6x8OvHsh301KV/+H7IB+T95DGsEjHQtPGqfDvYjwoo1iOgXb7Qd jQrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GMLD7fM0sXSygPEEn1GQHrpSr0o3MxgtlVk9jtYim58=; b=lLErDBr86nYMhHX/vcvoG5J0tvaCDVBbtxK34zDVutSau9KfiowTXXvjBFyJ1Yl/RQ uH4ia70BrdoTngccyRPohrqZeZ79iZPNSrwG2p3eGUpc1jotNdoSWk5zUKYk2FliA2oI B0q6vnsyqsHSXIOdyuyq2mOUm459FvO5QmHxWGXf4j+/u4JkUkiyB892gT7Ka0htF0Bb vNO2+4kA7klIvsZuGTQib7lZd9QG19OJbtu8vlEQS493xzOYpAegDl5pzs/naf/h824v TVv6c2nbY1wSKdvQ5WVkn0FHUcTcDw015HLWVf3Ytg9Qr+z11Uuw8eWrCmbRaylqP/6l 3bjg== X-Gm-Message-State: AOAM530LVYaXnz2NBgpbmAh804JrYWyIyrfnRPqXwxYaWw75ODfJLhjv 5+q9nDwgSRu0RMEkTSFVNCw= X-Google-Smtp-Source: ABdhPJyVc7GTwwBDNErvVmEbXEn+eX1ToD4Nc0VzDGuwWOW49My+kv/dR43V+n+GR8MKLDHSErlK7g== X-Received: by 2002:ac2:58e1:: with SMTP id v1mr410851lfo.336.1621267127332; Mon, 17 May 2021 08:58:47 -0700 (PDT) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id i8sm1996834lfd.12.2021.05.17.08.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 08:58:46 -0700 (PDT) From: Sergey Organov To: Junio C Hamano Cc: Jeff King , Philip Oakley , Elijah Newren , Felipe Contreras , =?utf-8?b?w4Z2YXIgQXJuZmo=?= =?utf-8?b?w7Zyw7AgQmphcm1hc29u?= , Alex Henrie , git@vger.kernel.org, Sergey Organov Subject: [PATCH v1 9/9] diff-merges: let "-m" imply "-p" Date: Mon, 17 May 2021 18:58:18 +0300 Message-Id: <20210517155818.32224-10-sorganov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517155818.32224-1-sorganov@gmail.com> References: <20210517155818.32224-1-sorganov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Fix long standing inconsistency between -c/--cc that do imply -p, on one side, and -m that did not imply -p, on the other side. Change corresponding test accordingly, as "log -m" output should now match one from "log -m -p", rather than from just "log". Change documentation accordingly. NOTES: After this patch git log -m will start to produce diffs without need to provide -p as well, that improves both consistency and usability. It gets even more useful if one sets "log.diffMerges" configuration variable to "first-parent" to force -m produce usual diff with respect to first parent only. This patch does not change behavior when specific diff format is explicitly provided on the command-line, so that commands like git log -m --raw git log -m --stat are not affected. Exact historical semantics of -m is still provided by --diff-merges=separate. Signed-off-by: Sergey Organov --- Documentation/diff-options.txt | 8 ++++---- diff-merges.c | 1 + t/t4013-diff-various.sh | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 530d1159141f..32e6dee5ac3b 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -49,10 +49,9 @@ ifdef::git-log[] --diff-merges=m::: -m::: This option makes diff output for merge commits to be shown in - the default format. `-m` will produce the output only if `-p` - is given as well. The default format could be changed using + the default format. The default format could be changed using `log.diffMerges` configuration parameter, which default value - is `separate`. + is `separate`. `-m` implies `-p`. + --diff-merges=first-parent::: --diff-merges=1::: @@ -62,7 +61,8 @@ ifdef::git-log[] --diff-merges=separate::: This makes merge commits show the full diff with respect to each of the parents. Separate log entry and diff is generated - for each parent. + for each parent. This is the format that `-m` produced + historically. + --diff-merges=combined::: --diff-merges=c::: diff --git a/diff-merges.c b/diff-merges.c index d897fd8a2933..0dfcaa1b11b0 100644 --- a/diff-merges.c +++ b/diff-merges.c @@ -107,6 +107,7 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv) if (!strcmp(arg, "-m")) { set_to_default(revs); + revs->merges_imply_patch = 1; } else if (!strcmp(arg, "-c")) { set_combined(revs); revs->merges_imply_patch = 1; diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index c35cc73d08bd..15ca3c75bff7 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -454,8 +454,8 @@ diff-tree --stat --compact-summary initial mode diff-tree -R --stat --compact-summary initial mode EOF -test_expect_success 'log -m matches pure log' ' - git log master >result && +test_expect_success 'log -m matches log -m -p' ' + git log -m -p master >result && process_diffs result >expected && git log -m >result && process_diffs result >actual &&