From patchwork Fri Sep 2 03:53:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12963617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD9EFC6FA81 for ; Fri, 2 Sep 2022 03:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235436AbiIBDxq (ORCPT ); Thu, 1 Sep 2022 23:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235431AbiIBDxf (ORCPT ); Thu, 1 Sep 2022 23:53:35 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F250B56C5 for ; Thu, 1 Sep 2022 20:53:34 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id n17-20020a05600c501100b003a84bf9b68bso642203wmr.3 for ; Thu, 01 Sep 2022 20:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=2x1cN/QUO0/83LkCFeNbesqr9VTXr52eUL3BvoBMMSU=; b=QyLSACcTUDHeBEtAyPg2wGQ73pKez+rt7DORrjRU5FBA3NgFY2SNsUF+C/jmpk9LrF a6/zzfz5jvcvvfAvQuBFznpsjYSedcVGL3ARAvfj+4+GTqY3wtMsEu9MD3tAXcSKNRjC lnI073GV8noL0CrXSPc0E01IWtSwFMuC3SN1+wNS/SiMUovanA7w8Ccg5wATG3YNMpKc HOWkjwm773PiOgZ6Zgyu35+/3zyHcJpzUtJ4mw1Bz+TwM6J1IFvoC8alUG2tzjS62+8J xjtB+HiIFmXp1CtIuJaJ9VjleLdMlr1AVU/q/uIBnCxCr+Cq8nI6fHTba7xOkdnk3M0g AfdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=2x1cN/QUO0/83LkCFeNbesqr9VTXr52eUL3BvoBMMSU=; b=R6+ThBaWlIEO2Pyeccunt+XbPmaayOvW1EJM4hPerXa8Br6CLJhDWi1SOhKz3lStzu lOwt7G2n0O7E1ijjLjwMdBUQ3s6IyiO6aP7CWHyHBxF4MVCrjPEU3/FGA99bNKddroo5 4HrCVuhlKOCcWlqQ9Lej+Lved/PIkcYl2WxTdo0o3/wzRaHQ2ATv41oBWIkq2vwC/gH1 syZikNYo/Ck2CUZNmRn7HOn9D4AuvhwibwDNzRrIHDhqFieX3WOmyL8SCQsr72CckLHy fEiiBNy/NDTlg4vrIdR4D+S5Pm2q7bsnP+J3OOfZKmJnT5BD86/M3EzWyTPyqQ8gKVK5 MDcg== X-Gm-Message-State: ACgBeo352nuM07ZpeuXjylJtNz6o3Mw5VFxUQEG+WyNnuZ3SFKO6KQVq 1NR8CgQgnXCLT9Yqgpes1Mm75z8t51M= X-Google-Smtp-Source: AA6agR5UkIWnvH4TaXrA349WVtH6A7pTloRIFjTzGNwoDYdE6237VCxtQnlQFWYoHKI1oWonYhfntw== X-Received: by 2002:a05:600c:512a:b0:3a8:42e4:dfe7 with SMTP id o42-20020a05600c512a00b003a842e4dfe7mr1272260wms.193.1662090812476; Thu, 01 Sep 2022 20:53:32 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o24-20020a1c7518000000b003a83ca67f73sm867530wmc.3.2022.09.01.20.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 20:53:31 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 02 Sep 2022 03:53:28 +0000 Subject: [PATCH v3 1/3] diff: have submodule_format logic avoid additional diff headers Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Philippe Blain , Elijah Newren , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Commit 95433eeed9 ("diff: add ability to insert additional headers for paths", 2022-02-02) introduced the possibility of additional headers, created in create_filepairs_for_header_only_notifications(). These are represented by inserting additional pairs in diff_queued_diff which always have a mode of 0 and a null_oid. When these were added, one code path was noted to assume that at least one of the diff_filespecs in the pair were valid, and that codepath was corrected. The submodule_format handling is another codepath with the same issue; it would operate on these additional headers and attempt to display them as submodule changes. Prevent that by explicitly checking for "phoney" filepairs (i.e. filepairs with both modes being 0). Reported-by: Philippe Blain Signed-off-by: Elijah Newren --- diff.c | 29 +++++++++++++++++++++++------ t/t4069-remerge-diff.sh | 8 ++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/diff.c b/diff.c index 974626a6211..7f8637f3006 100644 --- a/diff.c +++ b/diff.c @@ -3398,6 +3398,21 @@ static void add_formatted_headers(struct strbuf *msg, line_prefix, meta, reset); } +static int diff_filepair_is_phoney(struct diff_filespec *one, + struct diff_filespec *two) +{ + /* + * This function specifically looks for pairs injected by + * create_filepairs_for_header_only_notifications(). Such + * pairs are "phoney" in that they do not represent any + * content or even mode difference, but were inserted because + * diff_queued_diff previously had no pair associated with + * that path but we needed some pair to avoid losing the + * "remerge CONFLICT" header associated with the path. + */ + return !DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two); +} + static void builtin_diff(const char *name_a, const char *name_b, struct diff_filespec *one, @@ -3429,14 +3444,16 @@ static void builtin_diff(const char *name_a, if (o->submodule_format == DIFF_SUBMODULE_LOG && (!one->mode || S_ISGITLINK(one->mode)) && - (!two->mode || S_ISGITLINK(two->mode))) { + (!two->mode || S_ISGITLINK(two->mode)) && + (!diff_filepair_is_phoney(one, two))) { show_submodule_diff_summary(o, one->path ? one->path : two->path, &one->oid, &two->oid, two->dirty_submodule); return; } else if (o->submodule_format == DIFF_SUBMODULE_INLINE_DIFF && (!one->mode || S_ISGITLINK(one->mode)) && - (!two->mode || S_ISGITLINK(two->mode))) { + (!two->mode || S_ISGITLINK(two->mode)) && + (!diff_filepair_is_phoney(one, two))) { show_submodule_inline_diff(o, one->path ? one->path : two->path, &one->oid, &two->oid, two->dirty_submodule); @@ -3456,12 +3473,12 @@ static void builtin_diff(const char *name_a, b_two = quote_two(b_prefix, name_b + (*name_b == '/')); lbl[0] = DIFF_FILE_VALID(one) ? a_one : "/dev/null"; lbl[1] = DIFF_FILE_VALID(two) ? b_two : "/dev/null"; - if (!DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two)) { + if (diff_filepair_is_phoney(one, two)) { /* - * We should only reach this point for pairs from + * We should only reach this point for pairs generated from * create_filepairs_for_header_only_notifications(). For - * these, we should avoid the "/dev/null" special casing - * above, meaning we avoid showing such pairs as either + * these, we want to avoid the "/dev/null" special casing + * above, because we do not want such pairs shown as either * "new file" or "deleted file" below. */ lbl[0] = a_one; diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh index 9e7cac68b1c..e3e6fbd97b2 100755 --- a/t/t4069-remerge-diff.sh +++ b/t/t4069-remerge-diff.sh @@ -185,6 +185,14 @@ test_expect_success 'remerge-diff w/ diff-filter=U: all conflict headers, no dif test_cmp expect actual ' +test_expect_success 'submodule formatting ignores additional headers' ' + # Reuses "expect" from last testcase + + git show --oneline --remerge-diff --diff-filter=U --submodule=log >tmp && + sed -e "s/[0-9a-f]\{7,\}/HASH/g" tmp >actual && + test_cmp expect actual +' + test_expect_success 'remerge-diff w/ diff-filter=R: relevant file + conflict header' ' git log -1 --oneline resolution >tmp && cat <<-EOF >>tmp && From patchwork Fri Sep 2 03:53:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12963619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C78E0ECAAA1 for ; Fri, 2 Sep 2022 03:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235343AbiIBDxv (ORCPT ); Thu, 1 Sep 2022 23:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235432AbiIBDxg (ORCPT ); Thu, 1 Sep 2022 23:53:36 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FA06B56D9 for ; Thu, 1 Sep 2022 20:53:35 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id k9so772498wri.0 for ; Thu, 01 Sep 2022 20:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=x645O1zVYFnGA4NwKmisZG6lBYxy92sgJqAdRMhMqHg=; b=lVDsssV6RDDalybT8/nNnviu6TIAxdcuCVqpj0k6QBO6zrHW0ygIFg9po9yHg5o8Dh QtLETCsQ+G0a1lNxPH6rSOmao8Ck1l3DI0/tD4M/GP5JF2tqNjSlZLHlv7AvQpZywtzZ oKKcE1X8g8rrNgx99yhivR9yTliIW5Eu08uLnmvcBqvuK2X12r09PqYmisdmXIHexDWv PvlAHuXczSTrk/eJYo/fjyEzMUwpZhqldYbmG5fxXkuWS6YvuBPzuBqXWQocybb9Yklv 3p4DtPhZ2cHMBh/lgW4CIRx4sGuRUi007P18EGr32O7UKePPRa3hdcfWhlKtyy/VxEic UqeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=x645O1zVYFnGA4NwKmisZG6lBYxy92sgJqAdRMhMqHg=; b=i1wcXqF/iCjG528SQ+blQacLcH4DOOcPiJ/qhRcVH33IZnvzKqvwb6zxoEklXbh76k dLiS+mR/3HAUFYR5T4qdaEdSJJEwztJb/qQDmabFC4L+vgjHtcJauOeN2UDAT3xl12Sq fyR2moNgRrUWbiCqGm1ytyyNp5WmkCBOwAQSmn7edfourInFZnCeePVAkXRYVKDhgbB/ /f11YVP7Ef9HqpU+ZYcaYCBRo1006HvpHh55q3E8KGGIu/IRNDGkD7h2MD3uYEn0pPvC BQnOMPKrr4Uwt/SDmtPTm9aHr1l394PYVgckCqOlkAWk3KG/Fxagnyy7IY3/tmnQ+jxH 3zIQ== X-Gm-Message-State: ACgBeo0cz2BoMz7jGXOHzaRln8PkNqhAHMvzC7TJuBruJWBM78AD6mhS v76r2x+vTfQfsuf8ioGeFjDdOMqkom4= X-Google-Smtp-Source: AA6agR5tzY555QRefpLOuTJBsaWisQSM4grWc+TOlmPm7XMZ9Elhej4m2byc+UlJqJsuiPiJGceR4g== X-Received: by 2002:adf:f6cb:0:b0:220:7859:7bf with SMTP id y11-20020adff6cb000000b00220785907bfmr15429898wrp.683.1662090813394; Thu, 01 Sep 2022 20:53:33 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t6-20020a05600001c600b00226d2462b32sm450242wrx.52.2022.09.01.20.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 20:53:33 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Fri, 02 Sep 2022 03:53:29 +0000 Subject: [PATCH v3 2/3] diff: fix filtering of additional headers under --remerge-diff Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Philippe Blain , Elijah Newren , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Commit 95433eeed9 ("diff: add ability to insert additional headers for paths", 2022-02-02) introduced the possibility of additional headers. Because there could be conflicts with no content differences (e.g. a modify/delete conflict resolved in favor of taking the modified file as-is), that commit also modified the diff_queue_is_empty() and diff_flush_patch() logic to ensure these headers were included even if there was no associated content diff. However, when the pickaxe is active, we really only want the remerge conflict headers to be shown when there is an associated content diff. Adjust the logic in these two functions accordingly. This also removes the TEST_PASSES_SANITIZE_LEAK=true declaration from t4069, as there is apparently some kind of memory leak with the pickaxe code. Signed-off-by: Elijah Newren --- diff.c | 2 ++ t/t4069-remerge-diff.sh | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/diff.c b/diff.c index 7f8637f3006..2439310ae1f 100644 --- a/diff.c +++ b/diff.c @@ -5869,6 +5869,7 @@ static void diff_flush_patch(struct diff_filepair *p, struct diff_options *o) { int include_conflict_headers = (additional_headers(o, p->one->path) && + !o->pickaxe_opts && (!o->filter || filter_bit_tst(DIFF_STATUS_UNMERGED, o))); /* @@ -5924,6 +5925,7 @@ int diff_queue_is_empty(struct diff_options *o) int i; int include_conflict_headers = (o->additional_path_headers && + !o->pickaxe_opts && (!o->filter || filter_bit_tst(DIFF_STATUS_UNMERGED, o))); if (include_conflict_headers) diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh index e3e6fbd97b2..95a16d19aec 100755 --- a/t/t4069-remerge-diff.sh +++ b/t/t4069-remerge-diff.sh @@ -2,7 +2,6 @@ test_description='remerge-diff handling' -TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh # This test is ort-specific @@ -90,6 +89,22 @@ test_expect_success 'remerge-diff with both a resolved conflict and an unrelated test_cmp expect actual ' +test_expect_success 'pickaxe still includes additional headers for relevant changes' ' + # reuses "expect" from the previous testcase + + git log --oneline --remerge-diff -Sacht ab_resolution >tmp && + sed -e "s/[0-9a-f]\{7,\}/HASH/g" tmp >actual && + test_cmp expect actual +' + +test_expect_success 'can filter out additional headers with pickaxe' ' + git show --remerge-diff --submodule=log --find-object=HEAD ab_resolution >actual && + test_must_be_empty actual && + + git show --remerge-diff -S"not present" --all >actual && + test_must_be_empty actual +' + test_expect_success 'setup non-content conflicts' ' git switch --orphan base && From patchwork Fri Sep 2 03:53:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12963618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45B1CECAAD2 for ; Fri, 2 Sep 2022 03:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235454AbiIBDxs (ORCPT ); Thu, 1 Sep 2022 23:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235434AbiIBDxg (ORCPT ); Thu, 1 Sep 2022 23:53:36 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D79ECB516E for ; Thu, 1 Sep 2022 20:53:35 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id s23so517842wmj.4 for ; Thu, 01 Sep 2022 20:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date; bh=2dowF/lEOIh9jhEAp/HpYglkMI/Sao8T8/ed/D3fawQ=; b=Dk287DPFXJTs51as0xH7aYUEuHA3gjD5IVx+50FT9Wa93IYwaK1B/7tidtkkowOxye QqR945biBgKN5ww0QSB3Cb6o1/SGbmRxVdzYcdo8IfT709uYRm9Q+0u60/G5VJbLGjgL BtwWBV3U5Lbo1sB3SMckHgzbCXdMOYa59ITVwiL8JrmwGCWncMbazJTBzIOFqqBw0H4e Bzt6rgRoc8Lns/Tyx5L3u88R+h/wP9zW/PufMXD0q/x/27wT1gXj715ez8YOBhnBIXnx skvJSENcexokrV1QqH6FVNJ7Vty69UFM7GE2z6k/rHL/dz6k/dzjO4K3WuLmTywCSUAi CvZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date; bh=2dowF/lEOIh9jhEAp/HpYglkMI/Sao8T8/ed/D3fawQ=; b=f/JURgs4HSSB0nCI3yG+lDrTE5+4seb2qESuuECoiLRghN/zvvASwWEZ5vWJ1xwm2i jHVf0TpblfJc1b0D8RnDVUrJSHvTjec9GNUTfCgwdFbW1WIAy1gWtnCm1Ba1FhIEu5mv /b3Q8TUj58Xrqqmc/V/didsESr2CdP4+ImE0EUVrcXXx3cTe/Z9pamKMNlp7ZLBRLoh5 jU14T3tY171tGGfrLGQ1JhptHyiQrU+FJFInSh47EVfMmUbmYijGWxEcJeh+zw3tWNzI tP+O/AuOYbWQJGzn0Tzhu6F/k06f2ftyFTLxCRn9o8hSLxn2zl1Oib3WZzb8FSLVGZ6S CVDQ== X-Gm-Message-State: ACgBeo1RIct1xVVqIG9T81xAYI60ZoLyipoWlWJWFCFQadKHC51eRAZy M/rOHfDnDnYl7U3RSeNleJjzJ5ldMRk= X-Google-Smtp-Source: AA6agR5xTrtGIF9CMCbsjsLeiCYi042Ud4CEiROhiLq54t0t8UIEZHxVwnD95CT4JARdlDZVvI31jA== X-Received: by 2002:a05:600c:3ac4:b0:3a5:f6e5:1cbc with SMTP id d4-20020a05600c3ac400b003a5f6e51cbcmr1229902wms.92.1662090814265; Thu, 01 Sep 2022 20:53:34 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u5-20020adfeb45000000b0021e43b4edf0sm469341wrn.20.2022.09.01.20.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 20:53:33 -0700 (PDT) Message-Id: <084a037756d79d569c19bd85f30bae97b15ec26f.1662090810.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 03:53:30 +0000 Subject: [PATCH v3 3/3] diff: fix filtering of merge commits under --remerge-diff Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Philippe Blain , Elijah Newren , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Commit 95433eeed9 ("diff: add ability to insert additional headers for paths", 2022-02-02) introduced the possibility of additional headers. Because there could be conflicts with no content differences (e.g. a modify/delete conflict resolved in favor of taking the modified file as-is), that commit also modified the diff_queue_is_empty() and diff_flush_patch() logic to ensure these headers were included even if there was no associated content diff. However, the added logic was a bit inconsistent between these two functions. diff_queue_is_empty() overlooked the fact that the additional headers strmap could be non-NULL and empty, which would cause it to display commits that should have been filtered out. Fix the diff_queue_is_empty() logic to also account for additional_path_headers being empty. Reported-by: Philippe Blain Signed-off-by: Elijah Newren --- diff.c | 1 + t/t4069-remerge-diff.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/diff.c b/diff.c index 2439310ae1f..e1f9cef2f38 100644 --- a/diff.c +++ b/diff.c @@ -5925,6 +5925,7 @@ int diff_queue_is_empty(struct diff_options *o) int i; int include_conflict_headers = (o->additional_path_headers && + strmap_get_size(o->additional_path_headers) && !o->pickaxe_opts && (!o->filter || filter_bit_tst(DIFF_STATUS_UNMERGED, o))); diff --git a/t/t4069-remerge-diff.sh b/t/t4069-remerge-diff.sh index 95a16d19aec..07323ebafe0 100755 --- a/t/t4069-remerge-diff.sh +++ b/t/t4069-remerge-diff.sh @@ -56,6 +56,11 @@ test_expect_success 'remerge-diff on a clean merge' ' test_cmp expect actual ' +test_expect_success 'remerge-diff on a clean merge with a filter' ' + git show --oneline --remerge-diff --diff-filter=U bc_resolution >actual && + test_must_be_empty actual +' + test_expect_success 'remerge-diff with both a resolved conflict and an unrelated change' ' git log -1 --oneline ab_resolution >tmp && cat <<-EOF >>tmp &&