From patchwork Mon Oct 26 17:01:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 11857851 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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 1E987C4363A for ; Mon, 26 Oct 2020 17:03:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D08A622450 for ; Mon, 26 Oct 2020 17:03:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eWDvtC24" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1787104AbgJZRC4 (ORCPT ); Mon, 26 Oct 2020 13:02:56 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39587 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1775592AbgJZRBv (ORCPT ); Mon, 26 Oct 2020 13:01:51 -0400 Received: by mail-wm1-f65.google.com with SMTP id d3so13250834wma.4 for ; Mon, 26 Oct 2020 10:01:49 -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=LOsRglWXY+n9K3CRFstIO+D5wM+7Jv2UbOBcy+4tIHA=; b=eWDvtC24gdHnZ0CjOaf9M8UstTKQnfHRH/bhSLuqKQs1YxWdlDNCurEJxSnjU2APeV NjuFaro1PesszEqi3RpnxII4tb4iRdHlwlmZIXxgpTlmhj3YENEe7V2xOEyjg5UoDiX7 dLDQEePRgIExyqjDYC+2+zGg9XfEy7X9ftW9FSN2RS9mbiuqFUIy7rTTEvd5n1E5Pz+x 6HZyNcrabWT2WomH49D9Tkg7hWzBh5r53YAxkIag45LnhtOxBc8k9zoVQdkwGKiICPgp UlmCRP36ftNdhzXGwuW5J/GhEOZYQZK3Tqi95RL4Nt1aPlPD0VlB6SFRJhZgbqiT3a0B FrUw== 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=LOsRglWXY+n9K3CRFstIO+D5wM+7Jv2UbOBcy+4tIHA=; b=lsnPdd0MsPChWSU8Zyn46aHbgpnRbsI8yP6b/aKwYT/5p5eZJCr+L3oZ2fj+3z/JRk hMKWFAAcEayTKju69+9BfMurShOYdTmL/iUDD/UQ2/mBwEXIRMWnegWlf8CKi7zd8Z65 P2O2B4mj5Cm776TOrDB8tA0mx1afm7NsrwksbmBVoM6UV2owUf7PfHfGfrp9KtqxiDzs 5CMYrmtz7J0+QNDLro9jd4QHlge0XVW0zXrXxxKt82kEFX4gZupi55pKfPldxahHr7F3 Vz5htsvsmo7fu5saTFTFEVZ1gNw4UvnbHVwt6LUB3bPH6+Xa14EW9suP3Oapquh/4QFA aMoQ== X-Gm-Message-State: AOAM533AstWYZeLlRQKh3Rf1aZhSYlHww6xoCvd9842oPhJ7ZDan+5/H x0xY0RP5zDapjQI89cRbZoxKfGu0M6o= X-Google-Smtp-Source: ABdhPJySXzV0Nu4LFn+SilKMH/kZ3li2bKr5CvjrwcTZt5hLZfY2wotJKAMwGuHcPrDTd8aH0E3z1A== X-Received: by 2002:a7b:c750:: with SMTP id w16mr16217545wmk.136.1603731708950; Mon, 26 Oct 2020 10:01:48 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m1sm21618579wmm.34.2020.10.26.10.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:01:48 -0700 (PDT) Message-Id: <38919982c41f02edbdb62a6fac794bba597584e5.1603731704.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 26 Oct 2020 17:01:38 +0000 Subject: [PATCH v2 3/9] t6416: correct expectation for rename/rename(1to2) + directory/file Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren When files are renamed and modified, we need to do three-way content merges to get the appropriate content in the right location. When we have a rename/rename(1to2) conflict (both sides rename the same file, but differently), that merged content should be placed in each of the two resulting files. merge-recursive handled that fine when that was all that was involved, but when one or more of the two resulting files were ALSO involved in a directory/file conflict, it failed to propagate the merged content to that file. Unfortunately, the one test in t6416 that touched on this combination of cases had been coded to not expect the merged contents to be present. Fix the test to check for the right behavior, and record how the different merge backends will be expected to handle it. Signed-off-by: Elijah Newren --- t/t6416-recursive-corner-cases.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh index 0317e83970..887c2195a9 100755 --- a/t/t6416-recursive-corner-cases.sh +++ b/t/t6416-recursive-corner-cases.sh @@ -786,7 +786,7 @@ test_expect_success 'merge of D1 & E3 succeeds' ' ) ' -test_expect_success 'merge of D1 & E4 notifies user a and a2 are related' ' +test_expect_merge_algorithm failure success 'merge of D1 & E4 puts merge of a and a2 in both a and a2' ' test_when_finished "git -C directory-file reset --hard" && test_when_finished "git -C directory-file clean -fdqx" && ( @@ -804,7 +804,7 @@ test_expect_success 'merge of D1 & E4 notifies user a and a2 are related' ' test_line_count = 1 out && git rev-parse >expect \ - A:ignore-me B:a D1:a E4:a2 && + A:ignore-me B:a E4:a2 E4:a2 && git rev-parse >actual \ :0:ignore-me :1:a~Temporary\ merge\ branch\ 2 :2:a :3:a2 && test_cmp expect actual From patchwork Mon Oct 26 17:01:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 11857837 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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 0E3B0C4363A for ; Mon, 26 Oct 2020 17:02:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCC3F239D2 for ; Mon, 26 Oct 2020 17:02:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c28YwJVL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442910AbgJZRCy (ORCPT ); Mon, 26 Oct 2020 13:02:54 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42978 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1775616AbgJZRBx (ORCPT ); Mon, 26 Oct 2020 13:01:53 -0400 Received: by mail-wr1-f65.google.com with SMTP id j7so13458122wrt.9 for ; Mon, 26 Oct 2020 10:01:50 -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=xTh0/ZwZW6Ma8rEW81J5QgP6ZpGakFVaDbdYOH/CrOM=; b=c28YwJVL0f+87T199saFGqXrzmwjbN+T0BI6t9NyeaTUEkLdMtgKvq/L5GG7w1Caah VKaRY/E3KlZvVZwq+s491JVhAwE/Ie1bjsGcV/XBCpNswzY5t3u2uk1cJdj2txJd17yL ImpFfcCfMCVlE2yGdpjqcA4zvZf14pgFxf0QJ+Z+RPXH0uUQwpgALaJGaxomvqfMn9qX 7kBi1ZyekiEY2aM2vcUVfGf7aSvqhsBPLcsHIQtwNwXhP5tt5vEWDCtG6tJGXAiOAMnn rM5JUgKS9PbxtSAqffy9HlFvrg+1fALXfzS69i++hB9FAgW8c6ESQmS4Ecs3PkQ3xEDw 7uiw== 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=xTh0/ZwZW6Ma8rEW81J5QgP6ZpGakFVaDbdYOH/CrOM=; b=RQ8yGxw2Vhe8AkDNVP7EGM9/4TtbqbvCuVyb47XP2cBjxA9NA3F+NHel7XZPptRU20 PafIjKxOtxPlWsD35rzUwU0qlmkSIcUB8mtDrRdMDnWhDe/+waj5fRnIaqDyIftYtQLN +YyuG1NpfGOEZfNamo5fl2i+959LLY6O6F8U+uVjaf8LkY+O0IafMnFv6E8eYwLzFBQk x7wpwJQS2b/Bdy92AP/m9gZKM4rkUMjKXF4HiQk/Vl4m853m0dK5qzrHiWUgiafxY+AU TXrle2COU2SbuJdBLgvJymIlvQcH5v3F0b/Iuc5fISE37O31pS2YRYH7yhumB6zg3gmf QqPg== X-Gm-Message-State: AOAM530sfumuYIYaa4IdU1bX07G3yFIvReqJFvyWtXyV+7VNqu+UvyKY wZ776N4x2ORoxIzf+9R20TTs2p6JW1o= X-Google-Smtp-Source: ABdhPJzwkpbSjzfr2BtCQ9ISHcZPA3EcHvu9VHb73TjvHwcqnidIDlbSuyLGVg+XApgja/nJzWWaeQ== X-Received: by 2002:a5d:4d0c:: with SMTP id z12mr20473721wrt.60.1603731709704; Mon, 26 Oct 2020 10:01:49 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id s2sm24083310wmf.45.2020.10.26.10.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:01:49 -0700 (PDT) Message-Id: <6e47fa19f84a2017cad728aaa8170fb23aca45c7.1603731704.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 26 Oct 2020 17:01:39 +0000 Subject: [PATCH v2 4/9] t6404, t6423: expect improved rename/delete handling in ort backend Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren When a file is renamed and has content conflicts, merge-recursive does not have some stages for the old filename and some stages for the new filename in the index; instead it copies all the stages corresponding to the old filename over to the corresponding locations for the new filename, so that there are three higher order stages all corresponding to the new filename. Doing things this way makes it easier for the user to access the different versions and to resolve the conflict (no need to manually 'git rm' the old version as well as 'git add' the new one). rename/deletes should be handled similarly -- there should be two stages for the renamed file rather than just one. We do not want to destabilize merge-recursive right now, so instead update relevant tests to have different expectations depending on whether the "recursive" or "ort" merge strategies are in use. Signed-off-by: Elijah Newren --- t/t6404-recursive-merge.sh | 14 +++++- t/t6423-merge-rename-directories.sh | 70 ++++++++++++++++++++--------- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/t/t6404-recursive-merge.sh b/t/t6404-recursive-merge.sh index 332cfc53fd..b1c3d4dda4 100755 --- a/t/t6404-recursive-merge.sh +++ b/t/t6404-recursive-merge.sh @@ -118,12 +118,22 @@ test_expect_success 'mark rename/delete as unmerged' ' test_tick && git commit -m rename && test_must_fail git merge delete && - test 1 = $(git ls-files --unmerged | wc -l) && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test 2 = $(git ls-files --unmerged | wc -l) + else + test 1 = $(git ls-files --unmerged | wc -l) + fi && git rev-parse --verify :2:a2 && test_must_fail git rev-parse --verify :3:a2 && git checkout -f delete && test_must_fail git merge rename && - test 1 = $(git ls-files --unmerged | wc -l) && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test 2 = $(git ls-files --unmerged | wc -l) + else + test 1 = $(git ls-files --unmerged | wc -l) + fi && test_must_fail git rev-parse --verify :2:a2 && git rev-parse --verify :3:a2 ' diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh index 5ea77564d7..f9a3f24039 100755 --- a/t/t6423-merge-rename-directories.sh +++ b/t/t6423-merge-rename-directories.sh @@ -1271,17 +1271,32 @@ test_expect_success '6a: Tricky rename/delete' ' test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out && test_i18ngrep "CONFLICT (rename/delete).*z/c.*y/c" out && - git ls-files -s >out && - test_line_count = 2 out && - git ls-files -u >out && - test_line_count = 1 out && - git ls-files -o >out && - test_line_count = 1 out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + git ls-files -s >out && + test_line_count = 3 out && + git ls-files -u >out && + test_line_count = 2 out && + git ls-files -o >out && + test_line_count = 1 out && - git rev-parse >actual \ - :0:y/b :3:y/c && - git rev-parse >expect \ - O:z/b O:z/c && + git rev-parse >actual \ + :0:y/b :1:y/c :3:y/c && + git rev-parse >expect \ + O:z/b O:z/c O:z/c + else + git ls-files -s >out && + test_line_count = 2 out && + git ls-files -u >out && + test_line_count = 1 out && + git ls-files -o >out && + test_line_count = 1 out && + + git rev-parse >actual \ + :0:y/b :3:y/c && + git rev-parse >expect \ + O:z/b O:z/c + fi && test_cmp expect actual ) ' @@ -1934,17 +1949,32 @@ test_expect_success '7d: transitive rename involved in rename/delete; how is it test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out && test_i18ngrep "CONFLICT (rename/delete).*x/d.*y/d" out && - git ls-files -s >out && - test_line_count = 3 out && - git ls-files -u >out && - test_line_count = 1 out && - git ls-files -o >out && - test_line_count = 1 out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + git ls-files -s >out && + test_line_count = 4 out && + git ls-files -u >out && + test_line_count = 2 out && + git ls-files -o >out && + test_line_count = 1 out && - git rev-parse >actual \ - :0:y/b :0:y/c :3:y/d && - git rev-parse >expect \ - O:z/b O:z/c O:x/d && + git rev-parse >actual \ + :0:y/b :0:y/c :1:y/d :3:y/d && + git rev-parse >expect \ + O:z/b O:z/c O:x/d O:x/d + else + git ls-files -s >out && + test_line_count = 3 out && + git ls-files -u >out && + test_line_count = 1 out && + git ls-files -o >out && + test_line_count = 1 out && + + git rev-parse >actual \ + :0:y/b :0:y/c :3:y/d && + git rev-parse >expect \ + O:z/b O:z/c O:x/d + fi && test_cmp expect actual ) ' From patchwork Mon Oct 26 17:01:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 11857841 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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 ACD92C4363A for ; Mon, 26 Oct 2020 17:02:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 554A8239D2 for ; Mon, 26 Oct 2020 17:02:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WUuv412Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1787086AbgJZRCv (ORCPT ); Mon, 26 Oct 2020 13:02:51 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34933 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1775649AbgJZRBy (ORCPT ); Mon, 26 Oct 2020 13:01:54 -0400 Received: by mail-wr1-f67.google.com with SMTP id n15so13522757wrq.2 for ; Mon, 26 Oct 2020 10:01:52 -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=eKZPRv3w8Tguq142buKUGRuKN/QgSTIc/MTJNwMPLYQ=; b=WUuv412ZRxNssqacZGQi69wzQ8VPB6KF56jMtE+86WYuuTFy2Yg/SGOTvJ4JrPzwL0 NlyaHb9b4DOpRZlNdb//KBTUnx7S1lK8A3cDqTYbDsLllDoSmkt5T2gk0hTB+v/KGioo aA7eHnGRs5QZgY4GvZYlKKMsqGx27sdzW9RSWyC3l8MsXqbunze2xw41JQ476EZG9fvV Y+ryxmNHvonLa+RVedqTQWbgsnM7s+6lwuHqsBk4MaPE55AZQ/TOSDo6acopAC3+GyDG K1Eb1FY1pf+iOaaFx4alsS6+lkK8pUPmLn+rmd2+MbpfLIpWJ89k3yVoTiIO+kNJTQJx PRDQ== 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=eKZPRv3w8Tguq142buKUGRuKN/QgSTIc/MTJNwMPLYQ=; b=kls0Br059BsfQ6x5eAVovsOgZ0nZVJsBQBN31/n1VDYMUO1Dt6Q8PCs0ORswyZz/3w 21twp6NWzsic8fXLP5KAnfMNHUKrDv6n2TvRW9KxMH4Luq0CcrRLujMa5n5pvvc9qmbd x1I8/tN/HjzIS9mgo4DGiAqcqiz7HpAjgbb77Z52MY02hnR7Q+fdafF6pcuG+0mPpK66 QeKooOOqCx8lUf85hgQazH0EnyGYJPOAvPgu3W6+QULp2cgymzbzJVkMXVmuP3m0OFSH E36jDOfCTJpaOv12sWSESM8CMaadYbdtfZdLfDO4Z1TgA1DiE27E3+2HTNS9fGoRqie4 kPPw== X-Gm-Message-State: AOAM531cr4tIfxhJEqRYZURzG9IJMaIP4D/PPD+hzEO2K594JChDu3zf vuIaWMc7715LQs+jNsnGctXkwGofU4U= X-Google-Smtp-Source: ABdhPJwD8wKkKtVyaUGY1A7MRX7E/0i+9WwjI5JFBkZS0FtUovyHfK0wxp3T64Ub9vAmmTC749s/PA== X-Received: by 2002:adf:f4d2:: with SMTP id h18mr17924701wrp.99.1603731711563; Mon, 26 Oct 2020 10:01:51 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j7sm25296237wrn.81.2020.10.26.10.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:01:51 -0700 (PDT) Message-Id: <4f32450b085c921219b4639572e8fc2d5150b719.1603731704.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 26 Oct 2020 17:01:41 +0000 Subject: [PATCH v2 6/9] merge tests: expect slight differences in output for recursive vs. ort Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren The ort merge strategy has some slight differences in commit descriptions (shortened hashes), stdout vs stderr, and in conflict messages. Also, builtin/merge.c reports usage of "ort" as "Merge made by the 'ort' strategy" -- while it is meant as a drop in replacement for "recursive" it is not yet treated as though it is recursive. Update the testcases to expect different output for the different merge backends. Signed-off-by: Elijah Newren --- t/t6402-merge-rename.sh | 14 ++++++++++++-- t/t6437-submodule-merge.sh | 25 +++++++++++++++++++++---- t/t7602-merge-octopus-many.sh | 6 ++++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh index 47d4434d64..3f64f62224 100755 --- a/t/t6402-merge-rename.sh +++ b/t/t6402-merge-rename.sh @@ -320,7 +320,12 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' ' test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output && test_i18ngrep "Auto-merging dir" output && - test_i18ngrep "Adding as dir~HEAD instead" output && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_i18ngrep "moving it to dir~HEAD instead" output + else + test_i18ngrep "Adding as dir~HEAD instead" output + fi && test 3 -eq "$(git ls-files -u | wc -l)" && test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" && @@ -342,7 +347,12 @@ test_expect_success 'Same as previous, but merged other way' ' ! grep "error: refusing to lose untracked file at" errors && test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output && test_i18ngrep "Auto-merging dir" output && - test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_i18ngrep "moving it to dir~renamed-file-has-no-conflicts instead" output + else + test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output + fi && test 3 -eq "$(git ls-files -u | wc -l)" && test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" && diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh index 6a1e5f8232..3ead2b726f 100755 --- a/t/t6437-submodule-merge.sh +++ b/t/t6437-submodule-merge.sh @@ -127,7 +127,12 @@ test_expect_success 'merging should conflict for non fast-forward' ' git checkout -b test-nonforward b && (cd sub && git rev-parse sub-d > ../expect) && - test_must_fail git merge c 2> actual && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_must_fail git merge c >actual + else + test_must_fail git merge c 2> actual + fi && grep $(cat expect) actual > /dev/null && git reset --hard) ' @@ -138,9 +143,21 @@ test_expect_success 'merging should fail for ambiguous common parent' ' (cd sub && git checkout -b ambiguous sub-b && git merge sub-c && - git rev-parse sub-d > ../expect1 && - git rev-parse ambiguous > ../expect2) && - test_must_fail git merge c 2> actual && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + git rev-parse --short sub-d >../expect1 && + git rev-parse --short ambiguous >../expect2 + else + git rev-parse sub-d > ../expect1 && + git rev-parse ambiguous > ../expect2 + fi + ) && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_must_fail git merge c >actual + else + test_must_fail git merge c 2> actual + fi && grep $(cat expect1) actual > /dev/null && grep $(cat expect2) actual > /dev/null && git reset --hard) diff --git a/t/t7602-merge-octopus-many.sh b/t/t7602-merge-octopus-many.sh index 6abe441ae3..13859ec859 100755 --- a/t/t7602-merge-octopus-many.sh +++ b/t/t7602-merge-octopus-many.sh @@ -77,6 +77,12 @@ Merge made by the 'recursive' strategy. EOF test_expect_success 'merge reduces irrelevant remote heads' ' + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + mv expected expected.tmp && + sed s/recursive/ort/ expected.tmp >expected && + rm expected.tmp + fi && GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual && test_i18ncmp expected actual ' From patchwork Mon Oct 26 17:01:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 11857843 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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 38E88C5517A for ; Mon, 26 Oct 2020 17:02:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECC42206D4 for ; Mon, 26 Oct 2020 17:02:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BhPuk1R2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1786718AbgJZRCl (ORCPT ); Mon, 26 Oct 2020 13:02:41 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:36894 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1775658AbgJZRB4 (ORCPT ); Mon, 26 Oct 2020 13:01:56 -0400 Received: by mail-wr1-f46.google.com with SMTP id h7so13521085wre.4 for ; Mon, 26 Oct 2020 10:01:53 -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=/RJodLrhrZB0Tw1j/DElxsuBn696TMLb/sWHDwufkIU=; b=BhPuk1R247GmPonTCxLpquHTXJCsF3mPdGT0Ug29osY2Doy7Tihif62eSexIHSkaGn 93fnX01J+CBsJlxr8Zum3cgvS6xDvTBAzJ9o0VPN3x8KExg2fAvWx3tTdB5YPm4q1mE+ mV7Qx7DAAkuZsRpCxNgaMxAk7lQH8nQCSffEaKuFxPBUelnsPY4rTbuam8FpGBp5rN+f Ii3aEYlZRZFxe2A1Zl+eHqpOFcZa7WHz1Yif+xsPVfs+bN7j7ZV94Q/VDaN+qDw9N5zc bduJMVdUW/DSoDjt9WnrE31T528mOToubH1jUD//+mAv7GdlfatdOAYdim05KSS/t04L 8c7Q== 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=/RJodLrhrZB0Tw1j/DElxsuBn696TMLb/sWHDwufkIU=; b=NkYM50gkzkABDvacl8SGJmOXp1TQCcPC7U5a2TtBwKaBfEl4Dkem9nkdZEMvdIdDYe H7HW8A4HQSaZIdWQM+hoAT+E2BBgcw7yrd1Wjm+oFVaIxb5r/RiHMu9ZaHhUg8Yrh5W0 1iWftfboV+XhgljLttp99yZSmFNWsx6nDK4bXn+rWcboNfFK4sMNvLwKZdJijN/md1WC WKH54faGBJBVV0fZRF0V1WCVyKc/tZ1vPClR8FeKYxcZKR7niOfxb76DH0WbTeqT9QDM WGfkmeQpqiNXWluotYiDF8k3ihu1rx/H/4kRyNrbGSEKfAaspmW4hqo8bM3lXBlcEjAL AQVA== X-Gm-Message-State: AOAM5320Zst38te7nT4Mk204E31/Kbcwo+2B5MLFjPIhjEK23fF/5MfL 8OYsI7QqUyIHmx+KVQ2/w2vrsWvD390= X-Google-Smtp-Source: ABdhPJynLHwC/ylSRouw2GuXOtXKJ4/ByVINOaVvOyV+gfPW1wo8PkGwWXRGCrKDL0ph1pJ4KOtjPw== X-Received: by 2002:a05:6000:1050:: with SMTP id c16mr18836086wrx.400.1603731712362; Mon, 26 Oct 2020 10:01:52 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w6sm16239910wmb.28.2020.10.26.10.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:01:51 -0700 (PDT) Message-Id: In-Reply-To: References: Date: Mon, 26 Oct 2020 17:01:42 +0000 Subject: [PATCH v2 7/9] t6423, t6436: note improved ort handling with dirty files Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren The "recursive" backend relies on unpack_trees() to check if unstaged changes would be overwritten by a merge, but unpack_trees() does not understand renames -- and once it returns, it has already written many updates to the working tree and index. As such, "recursive" had to do a special 4-way merge where it would need to also treat the working copy as an extra source of differences that we had to carefully avoid overwriting and resulting in moving files to new locations to avoid conflicts. The "ort" backend, by contrast, does the complete merge inmemory, and only updates the index and working copy as a post-processing step. If there are dirty files in the way, it can simply abort the merge. Update t6423 and t6436 to reflect the better merge abilities and expectations we have for ort, while still leaving the best-case-as-good-as-recursive-can-do expectations there for the recursive backend so we retain its stability until we are ready to deprecate and remove it. Signed-off-by: Elijah Newren --- t/t6423-merge-rename-directories.sh | 266 ++++++++++++++++------------ t/t6436-merge-overwrite.sh | 18 +- 2 files changed, 165 insertions(+), 119 deletions(-) diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh index 7e32626913..32e6925ca4 100755 --- a/t/t6423-merge-rename-directories.sh +++ b/t/t6423-merge-rename-directories.sh @@ -3634,28 +3634,35 @@ test_expect_success '11a: Avoid losing dirty contents with simple rename' ' echo stuff >>z/c && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "Refusing to lose dirty file at z/c" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err + else + test_i18ngrep "Refusing to lose dirty file at z/c" out && - test_seq 1 10 >expected && - echo stuff >>expected && - test_cmp expected z/c && + git ls-files -s >out && + test_line_count = 2 out && + git ls-files -u >out && + test_line_count = 1 out && + git ls-files -o >out && + test_line_count = 3 out && - git ls-files -s >out && - test_line_count = 2 out && - git ls-files -u >out && - test_line_count = 1 out && - git ls-files -o >out && - test_line_count = 4 out && + git rev-parse >actual \ + :0:z/a :2:z/c && + git rev-parse >expect \ + O:z/a B:z/b && + test_cmp expect actual && - git rev-parse >actual \ - :0:z/a :2:z/c && - git rev-parse >expect \ - O:z/a B:z/b && - test_cmp expect actual && + git hash-object z/c~HEAD >actual && + git rev-parse B:z/b >expect && + test_cmp expect actual + fi && + + test_seq 1 10 >expected && + echo stuff >>expected && + test_cmp expected z/c - git hash-object z/c~HEAD >actual && - git rev-parse B:z/b >expect && - test_cmp expect actual ) ' @@ -3706,32 +3713,39 @@ test_expect_success '11b: Avoid losing dirty file involved in directory rename' git checkout A^0 && echo stuff >>z/c && - git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "Refusing to lose dirty file at z/c" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err + else + git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && + test_i18ngrep "Refusing to lose dirty file at z/c" out && - grep -q stuff z/c && - test_seq 1 10 >expected && - echo stuff >>expected && - test_cmp expected z/c && + git ls-files -s >out && + test_line_count = 3 out && + git ls-files -u >out && + test_line_count = 0 out && + git ls-files -m >out && + test_line_count = 0 out && + git ls-files -o >out && + test_line_count = 3 out && - git ls-files -s >out && - test_line_count = 3 out && - git ls-files -u >out && - test_line_count = 0 out && - git ls-files -m >out && - test_line_count = 0 out && - git ls-files -o >out && - test_line_count = 4 out && + git rev-parse >actual \ + :0:x/b :0:y/a :0:y/c && + git rev-parse >expect \ + O:x/b O:z/a B:x/c && + test_cmp expect actual && - git rev-parse >actual \ - :0:x/b :0:y/a :0:y/c && - git rev-parse >expect \ - O:x/b O:z/a B:x/c && - test_cmp expect actual && + git hash-object y/c >actual && + git rev-parse B:x/c >expect && + test_cmp expect actual + fi && - git hash-object y/c >actual && - git rev-parse B:x/c >expect && - test_cmp expect actual + grep -q stuff z/c && + test_seq 1 10 >expected && + echo stuff >>expected && + test_cmp expected z/c ) ' @@ -3783,7 +3797,13 @@ test_expect_success '11c: Avoid losing not-uptodate with rename + D/F conflict' echo stuff >>y/c && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "following files would be overwritten by merge" err && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err + else + test_i18ngrep "following files would be overwritten by merge" err + fi && grep -q stuff y/c && test_seq 1 10 >expected && @@ -3851,29 +3871,35 @@ test_expect_success '11d: Avoid losing not-uptodate with rename + D/F conflict' echo stuff >>z/c && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "Refusing to lose dirty file at z/c" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err + else + test_i18ngrep "Refusing to lose dirty file at z/c" out && - grep -q stuff z/c && - test_seq 1 10 >expected && - echo stuff >>expected && - test_cmp expected z/c && + git ls-files -s >out && + test_line_count = 4 out && + git ls-files -u >out && + test_line_count = 1 out && + git ls-files -o >out && + test_line_count = 4 out && - git ls-files -s >out && - test_line_count = 4 out && - git ls-files -u >out && - test_line_count = 1 out && - git ls-files -o >out && - test_line_count = 5 out && + git rev-parse >actual \ + :0:x/b :0:y/a :0:y/c/d :3:y/c && + git rev-parse >expect \ + O:x/b O:z/a B:y/c/d B:x/c && + test_cmp expect actual && - git rev-parse >actual \ - :0:x/b :0:y/a :0:y/c/d :3:y/c && - git rev-parse >expect \ - O:x/b O:z/a B:y/c/d B:x/c && - test_cmp expect actual && + git hash-object y/c~HEAD >actual && + git rev-parse B:x/c >expect && + test_cmp expect actual + fi && - git hash-object y/c~HEAD >actual && - git rev-parse B:x/c >expect && - test_cmp expect actual + grep -q stuff z/c && + test_seq 1 10 >expected && + echo stuff >>expected && + test_cmp expected z/c ) ' @@ -3931,37 +3957,43 @@ test_expect_success '11e: Avoid deleting not-uptodate with dir rename/rename(1to echo mods >>y/c && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "CONFLICT (rename/rename)" out && - test_i18ngrep "Refusing to lose dirty file at y/c" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err + else + test_i18ngrep "CONFLICT (rename/rename)" out && + test_i18ngrep "Refusing to lose dirty file at y/c" out && - git ls-files -s >out && - test_line_count = 7 out && - git ls-files -u >out && - test_line_count = 4 out && - git ls-files -o >out && - test_line_count = 3 out && + git ls-files -s >out && + test_line_count = 7 out && + git ls-files -u >out && + test_line_count = 4 out && + git ls-files -o >out && + test_line_count = 3 out && + + git rev-parse >actual \ + :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :2:y/c :3:y/c && + git rev-parse >expect \ + O:z/a O:z/b O:x/d O:x/c O:x/c A:y/c O:x/c && + test_cmp expect actual && + + # See if y/c~merged has expected contents; requires manually + # doing the expected file merge + git cat-file -p A:y/c >c1 && + git cat-file -p B:z/c >c2 && + >empty && + test_must_fail git merge-file \ + -L "HEAD" \ + -L "" \ + -L "B^0" \ + c1 empty c2 && + test_cmp c1 y/c~merged + fi && echo different >expected && echo mods >>expected && - test_cmp expected y/c && - - git rev-parse >actual \ - :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :2:y/c :3:y/c && - git rev-parse >expect \ - O:z/a O:z/b O:x/d O:x/c O:x/c A:y/c O:x/c && - test_cmp expect actual && - - # See if y/c~merged has expected contents; requires manually - # doing the expected file merge - git cat-file -p A:y/c >c1 && - git cat-file -p B:z/c >c2 && - >empty && - test_must_fail git merge-file \ - -L "HEAD" \ - -L "" \ - -L "B^0" \ - c1 empty c2 && - test_cmp c1 y/c~merged + test_cmp expected y/c ) ' @@ -4014,38 +4046,44 @@ test_expect_success '11f: Avoid deleting not-uptodate with dir rename/rename(2to echo important >>y/wham && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "CONFLICT (rename/rename)" out && - test_i18ngrep "Refusing to lose dirty file at y/wham" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err + else + test_i18ngrep "CONFLICT (rename/rename)" out && + test_i18ngrep "Refusing to lose dirty file at y/wham" out && - git ls-files -s >out && - test_line_count = 4 out && - git ls-files -u >out && - test_line_count = 2 out && - git ls-files -o >out && - test_line_count = 3 out && + git ls-files -s >out && + test_line_count = 4 out && + git ls-files -u >out && + test_line_count = 2 out && + git ls-files -o >out && + test_line_count = 3 out && - test_seq 1 10 >expected && - echo important >>expected && - test_cmp expected y/wham && + test_must_fail git rev-parse :1:y/wham && - test_must_fail git rev-parse :1:y/wham && + git rev-parse >actual \ + :0:y/a :0:y/b :2:y/wham :3:y/wham && + git rev-parse >expect \ + O:z/a O:z/b O:x/c O:x/d && + test_cmp expect actual && - git rev-parse >actual \ - :0:y/a :0:y/b :2:y/wham :3:y/wham && - git rev-parse >expect \ - O:z/a O:z/b O:x/c O:x/d && - test_cmp expect actual && + # Test that two-way merge in y/wham~merged is as expected + git cat-file -p :2:y/wham >expect && + git cat-file -p :3:y/wham >other && + >empty && + test_must_fail git merge-file \ + -L "HEAD" \ + -L "" \ + -L "B^0" \ + expect empty other && + test_cmp expect y/wham~merged + fi && - # Test that the two-way merge in y/wham~merged is as expected - git cat-file -p :2:y/wham >expect && - git cat-file -p :3:y/wham >other && - >empty && - test_must_fail git merge-file \ - -L "HEAD" \ - -L "" \ - -L "B^0" \ - expect empty other && - test_cmp expect y/wham~merged + test_seq 1 10 >expected && + echo important >>expected && + test_cmp expected y/wham ) ' diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh index dd8ab7ede1..dd9376842f 100755 --- a/t/t6436-merge-overwrite.sh +++ b/t/t6436-merge-overwrite.sh @@ -97,11 +97,19 @@ test_expect_success 'will not overwrite unstaged changes in renamed file' ' git mv c1.c other.c && git commit -m rename && cp important other.c && - test_must_fail git merge c1a >out && - test_i18ngrep "Refusing to lose dirty file at other.c" out && - test_path_is_file other.c~HEAD && - test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) && - test_cmp important other.c + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_must_fail git merge c1a >out 2>err && + test_i18ngrep "would be overwritten by merge" err && + test_cmp important other.c && + test_path_is_missing .git/MERGE_HEAD + else + test_must_fail git merge c1a >out && + test_i18ngrep "Refusing to lose dirty file at other.c" out && + test_path_is_file other.c~HEAD && + test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) && + test_cmp important other.c + fi ' test_expect_success 'will not overwrite untracked subtree' ' From patchwork Mon Oct 26 17:01:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 11857835 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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 964BAC5517A for ; Mon, 26 Oct 2020 17:02:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 513782067B for ; Mon, 26 Oct 2020 17:02:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rN7/G7z9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1787071AbgJZRCl (ORCPT ); Mon, 26 Oct 2020 13:02:41 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40304 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1775672AbgJZRB6 (ORCPT ); Mon, 26 Oct 2020 13:01:58 -0400 Received: by mail-wm1-f65.google.com with SMTP id k18so13214387wmj.5 for ; Mon, 26 Oct 2020 10:01:54 -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=6GQbWuh37mT7te6bMTumGT3vAbVRprkgFjHvwvPU8nI=; b=rN7/G7z9RvATaYj7/PuwvSrRUEq1CDb2+Lay2ovD2UXccW9R/sAAItiOliL0GkuslS sg8d93Y2XQElvknTU+UfpDkldT/BfrtodM9LdaJqHovWUKjanoA6Q/aWiV403o14w35j HetH5EP2JruJW+kBiAbnpJH6YD2SwJ92bY+iGbiK25GOvNYbit4vKDFI1AlH7pC6kjAk Ys0tMjF9i75YYjCIhEyOWkMbgkkSjc24WltzmOf+2vjO4e8hsJsUihQN2bCRRK1btL/5 Yq2L711DpNvsRaR31b6d+BkI3t6chFgLqEeeoIXbr9mV75rvAwIdErtuyOqXXO1EtI/V k3XA== 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=6GQbWuh37mT7te6bMTumGT3vAbVRprkgFjHvwvPU8nI=; b=tVZVx7rVqSOr+3OvgPvNDwKAacAbPvNrxy1wkVlqjGS28Z2CJWuDylz+fq1ErHbkTK 6AAZ04pf0471oG12f3fQBD2/yreBhW+LzWss8NNbcxjoSeRCd524ATJm2Ou8C59VIPhS XuXoZGjkyGczeGuaQVtgZwoLs5k1qISHqiOOUhCdGyTv+nrnogjJGamTGs+3aMyooEA6 DNjmCwl0Xw3Jb1kGTz6RYC99EFr3xCMbunTokEIDO0ldR8E0a8jRV3E63HVSLBd63aU+ zbpLmkeCcdLISJwrrdoGAwyWdoqBGvsg2D77izhePkyG73fombCBgcOH0iX6Vr9sB1x8 UndQ== X-Gm-Message-State: AOAM530Uicywx4MJ8sIYHIcH0ELhs8L+VedfTBzFlekH2NBVL/VPE89Y AzP51NC9JewbDj+ugR/T9NAPNYKXNfs= X-Google-Smtp-Source: ABdhPJzV7Ztsln4tbIzVCgIoA5OPQUT9rRP10tQ36e+0riq8jR4SSNFXTlvG34G/m1j2PSuC3g36+Q== X-Received: by 2002:a1c:bdc4:: with SMTP id n187mr17944107wmf.185.1603731713247; Mon, 26 Oct 2020 10:01:53 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 24sm20428484wmf.44.2020.10.26.10.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:01:52 -0700 (PDT) Message-Id: <6fd224247d9ccc1e6283a1e5a2c5678a1a0699b6.1603731704.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 26 Oct 2020 17:01:43 +0000 Subject: [PATCH v2 8/9] t6423: note improved ort handling with untracked files Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Similar to the previous commit, since the "recursive" backend relies on unpack_trees() to check if unstaged or untracked files would be overwritten by a merge, and unpack_trees() does not understand renames -- it has false positives and false negatives. Once it has run, since it updates as it goes, merge-recursive then has to handle completing the merge as best it can despite extra changes in the working copy. However, this is not just an issue for dirty files, but also for untracked files because directory renames can cause file contents to need to be written to a location that was not tracked on either side of history. Since the "ort" backend does the complete merge inmemory, and only updates the index and working copy as a post-processing step, if there are untracked files in the way it can simply abort the merge much like checkout does. Update t6423 to reflect the better merge abilities and expectations for ort, while still leaving the best-case-as-good-as-recursive-can-do expectations there for the recursive backend so we retain its stability until we are ready to deprecate and remove it. Signed-off-by: Elijah Newren --- t/t6423-merge-rename-directories.sh | 195 ++++++++++++++++++---------- 1 file changed, 124 insertions(+), 71 deletions(-) diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh index 32e6925ca4..db694a6316 100755 --- a/t/t6423-merge-rename-directories.sh +++ b/t/t6423-merge-rename-directories.sh @@ -3214,6 +3214,7 @@ test_expect_success '10a: Overwrite untracked with normal rename/delete' ' echo important >z/d && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && + test_path_is_missing .git/MERGE_HEAD && test_i18ngrep "The following untracked working tree files would be overwritten by merge" err && git ls-files -s >out && @@ -3283,21 +3284,34 @@ test_expect_success '10b: Overwrite untracked with dir rename + delete' ' echo contents >y/e && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out && - test_i18ngrep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err && - git ls-files -s >out && - test_line_count = 3 out && - git ls-files -u >out && - test_line_count = 2 out && - git ls-files -o >out && - test_line_count = 5 out && + git ls-files -s >out && + test_line_count = 1 out && + git ls-files -u >out && + test_line_count = 0 out && + git ls-files -o >out && + test_line_count = 5 out + else + test_i18ngrep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out && + test_i18ngrep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out && - git rev-parse >actual \ - :0:y/b :3:y/d :3:y/e && - git rev-parse >expect \ - O:z/b O:z/c B:z/e && - test_cmp expect actual && + git ls-files -s >out && + test_line_count = 3 out && + git ls-files -u >out && + test_line_count = 2 out && + git ls-files -o >out && + test_line_count = 5 out && + + git rev-parse >actual \ + :0:y/b :3:y/d :3:y/e && + git rev-parse >expect \ + O:z/b O:z/c B:z/e && + test_cmp expect actual + fi && echo very >expect && test_cmp expect y/c && @@ -3360,25 +3374,38 @@ test_expect_success '10c1: Overwrite untracked with dir rename/rename(1to2)' ' echo important >y/c && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "CONFLICT (rename/rename)" out && - test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err && - git ls-files -s >out && - test_line_count = 6 out && - git ls-files -u >out && - test_line_count = 3 out && - git ls-files -o >out && - test_line_count = 3 out && + git ls-files -s >out && + test_line_count = 4 out && + git ls-files -u >out && + test_line_count = 0 out && + git ls-files -o >out && + test_line_count = 3 out + else + test_i18ngrep "CONFLICT (rename/rename)" out && + test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out && - git rev-parse >actual \ - :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :3:y/c && - git rev-parse >expect \ - O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c && - test_cmp expect actual && + git ls-files -s >out && + test_line_count = 6 out && + git ls-files -u >out && + test_line_count = 3 out && + git ls-files -o >out && + test_line_count = 3 out && - git hash-object y/c~B^0 >actual && - git rev-parse O:x/c >expect && - test_cmp expect actual && + git rev-parse >actual \ + :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :3:y/c && + git rev-parse >expect \ + O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c && + test_cmp expect actual && + + git hash-object y/c~B^0 >actual && + git rev-parse O:x/c >expect && + test_cmp expect actual + fi && echo important >expect && test_cmp expect y/c @@ -3398,25 +3425,38 @@ test_expect_success '10c2: Overwrite untracked with dir rename/rename(1to2), oth echo important >y/c && test_must_fail git -c merge.directoryRenames=true merge -s recursive A^0 >out 2>err && - test_i18ngrep "CONFLICT (rename/rename)" out && - test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err && - git ls-files -s >out && - test_line_count = 6 out && - git ls-files -u >out && - test_line_count = 3 out && - git ls-files -o >out && - test_line_count = 3 out && + git ls-files -s >out && + test_line_count = 4 out && + git ls-files -u >out && + test_line_count = 0 out && + git ls-files -o >out && + test_line_count = 3 out + else + test_i18ngrep "CONFLICT (rename/rename)" out && + test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out && - git rev-parse >actual \ - :0:y/a :0:y/b :0:x/d :1:x/c :3:w/c :2:y/c && - git rev-parse >expect \ - O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c && - test_cmp expect actual && + git ls-files -s >out && + test_line_count = 6 out && + git ls-files -u >out && + test_line_count = 3 out && + git ls-files -o >out && + test_line_count = 3 out && - git hash-object y/c~HEAD >actual && - git rev-parse O:x/c >expect && - test_cmp expect actual && + git rev-parse >actual \ + :0:y/a :0:y/b :0:x/d :1:x/c :3:w/c :2:y/c && + git rev-parse >expect \ + O:z/a O:z/b O:x/d O:x/c O:x/c O:x/c && + test_cmp expect actual && + + git hash-object y/c~HEAD >actual && + git rev-parse O:x/c >expect && + test_cmp expect actual + fi && echo important >expect && test_cmp expect y/c @@ -3474,37 +3514,50 @@ test_expect_success '10d: Delete untracked with dir rename/rename(2to1)' ' echo important >y/wham && test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err && - test_i18ngrep "CONFLICT (rename/rename)" out && - test_i18ngrep "Refusing to lose untracked file at y/wham" out && + if test "$GIT_TEST_MERGE_ALGORITHM" = ort + then + test_path_is_missing .git/MERGE_HEAD && + test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err && - git ls-files -s >out && - test_line_count = 6 out && - git ls-files -u >out && - test_line_count = 2 out && - git ls-files -o >out && - test_line_count = 3 out && + git ls-files -s >out && + test_line_count = 6 out && + git ls-files -u >out && + test_line_count = 0 out && + git ls-files -o >out && + test_line_count = 3 out + else + test_i18ngrep "CONFLICT (rename/rename)" out && + test_i18ngrep "Refusing to lose untracked file at y/wham" out && - git rev-parse >actual \ - :0:y/a :0:y/b :0:y/d :0:y/e :2:y/wham :3:y/wham && - git rev-parse >expect \ - O:z/a O:z/b O:x/d O:x/e O:z/c O:x/f && - test_cmp expect actual && + git ls-files -s >out && + test_line_count = 6 out && + git ls-files -u >out && + test_line_count = 2 out && + git ls-files -o >out && + test_line_count = 3 out && + + git rev-parse >actual \ + :0:y/a :0:y/b :0:y/d :0:y/e :2:y/wham :3:y/wham && + git rev-parse >expect \ + O:z/a O:z/b O:x/d O:x/e O:z/c O:x/f && + test_cmp expect actual && - test_must_fail git rev-parse :1:y/wham && + test_must_fail git rev-parse :1:y/wham && - echo important >expect && - test_cmp expect y/wham && + # Test that two-way merge in y/wham~merged is as expected + git cat-file -p :2:y/wham >expect && + git cat-file -p :3:y/wham >other && + >empty && + test_must_fail git merge-file \ + -L "HEAD" \ + -L "" \ + -L "B^0" \ + expect empty other && + test_cmp expect y/wham~merged + fi && - # Test that the two-way merge in y/wham~merged is as expected - git cat-file -p :2:y/wham >expect && - git cat-file -p :3:y/wham >other && - >empty && - test_must_fail git merge-file \ - -L "HEAD" \ - -L "" \ - -L "B^0" \ - expect empty other && - test_cmp expect y/wham~merged + echo important >expect && + test_cmp expect y/wham ) ' From patchwork Mon Oct 26 17:01:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 11857839 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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 A580BC4363A for ; Mon, 26 Oct 2020 17:02:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 691A02067B for ; Mon, 26 Oct 2020 17:02:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n9yspRMq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1787077AbgJZRCl (ORCPT ); Mon, 26 Oct 2020 13:02:41 -0400 Received: from mail-wm1-f44.google.com ([209.85.128.44]:53223 "EHLO mail-wm1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1786821AbgJZRB6 (ORCPT ); Mon, 26 Oct 2020 13:01:58 -0400 Received: by mail-wm1-f44.google.com with SMTP id c194so12409208wme.2 for ; Mon, 26 Oct 2020 10:01:55 -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=2mpRIinLJnrUhtC1xJIdwbTVBuUCv8xBw3tYAaTtAaQ=; b=n9yspRMq6WagL+ywwUHULIAzWQk/rwnel8ziWFJYv20+vn1C7LDuQBZ7yRWT6QTjPu /tpGjWNkTvy7asZjcCM2y9hrBJxDMN7dKINi+ErF2X+1hl6KLOt8zgKsEjq9FVC36yCT CKJldGhSBZggqo5MLa5Y5++GUFed8dTD5WyPjONoSTzQ256/8HYDL1udBcIXK+CZWtl9 H083nVFP0l420sMzPlXQD7QU1IlPNAdPCA2j0rU3R2KrKnu3JiCIiEE7aGFqzNFg/vEc KBN4a642N4NqUEfcokQNsi1TaqOq5AuRKf+h1cFEXfN+A2RlN/jq9uEdw1OfUxU+QSvT K3+w== 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=2mpRIinLJnrUhtC1xJIdwbTVBuUCv8xBw3tYAaTtAaQ=; b=i0O+FdmB2lv29YuoLdUyQBqgiAgbWOTx19IxbpY4Q2vZr4xvcUTQUmiO0p6pSZ0BXq NxSh1xTIVV5frDgSOrahID6H0RvVaIb+EL4Wari7TwvIOj7z7YNwHF9fkAp5NRCQxfKS szJdU/AyutX3sKFkFIkWx6RacCS3FEYp4BiSRuZjK/WPJJEvaG13a2b3y7Qrg8gnN9xd JNBnO74ZNMYkT2+SsEAu/MsvDIQQ4iuCIwLYhvbwJsG7L8pkBZ8TTyEdKDjkcjaFDqPX JrQaoFBWR57AdxnABitVoTnfVPwo2S10sBA2wFG/PtKQw7l+XXCcHW7nRRPQoR1fCl79 m9dg== X-Gm-Message-State: AOAM532VPBueiQiiobjDlSWduCu18Cc5AXHtyV/w/j+vgHBPOGHBMhhG yxW/M6DbWjzcfzK1izD3k344hWom2QI= X-Google-Smtp-Source: ABdhPJyEKW8iP8GrOEvMvL3hFByGRC+3f8iWCJ8X/kv9n54y5VX685Vxq1W//+1WZw5u17lu1xE7qQ== X-Received: by 2002:a1c:254:: with SMTP id 81mr12542467wmc.21.1603731714528; Mon, 26 Oct 2020 10:01:54 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b18sm1898484wmj.41.2020.10.26.10.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 10:01:54 -0700 (PDT) Message-Id: <6e308768ff925eb4858be3247976526b21c3a464.1603731704.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Mon, 26 Oct 2020 17:01:44 +0000 Subject: [PATCH v2 9/9] t6423: add more details about direct resolution of directories Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Elijah Newren , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Signed-off-by: Elijah Newren --- t/t6423-merge-rename-directories.sh | 39 +++++++++++++++++------------ 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh index db694a6316..4ab133f489 100755 --- a/t/t6423-merge-rename-directories.sh +++ b/t/t6423-merge-rename-directories.sh @@ -4725,20 +4725,22 @@ test_expect_success '12e: Rename/merge subdir into the root, variant 2' ' # folder/subdir/newsubdir/e_Merge2 # folder/subdir/tweaked/{h,Makefile_SUB_Merge1,newfile.py} # folder/unchanged/ -# -# Notes: This testcase happens to exercise lots of the -# optimization-specific codepaths in merge-ort, and also -# demonstrated a failing of the directory rename detection algorithm -# in merge-recursive; newfile.c should not get pushed into -# folder/subdir/newsubdir/, yet merge-recursive put it there because -# the rename of dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d} -# looks like -# dir/ -> folder/, -# whereas the rename of dir/subdir/e -> folder/subdir/newsubdir/e -# looks like -# dir/subdir/ -> folder/subdir/newsubdir/ -# and if we note that newfile.c is found in dir/subdir/, we might -# overlook the dir/ -> folder/ rule that has more weight. +# Things being checked here: +# 1. dir/subdir/newfile.c does not get pushed into folder/subdir/newsubdir/. +# dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d} looks like +# dir/ -> folder/, +# whereas dir/subdir/e -> folder/subdir/newsubdir/e looks like +# dir/subdir/ -> folder/subdir/newsubdir/ +# and if we note that newfile.c is found in dir/subdir/, we might overlook +# the dir/ -> folder/ rule that has more weight. Older git versions did +# this. +# 2. The code to do trivial directory resolves. Note that +# dir/subdir/unchanged/ is unchanged and can be deleted, and files in the +# new folder/subdir/unchanged/ are not needed as a target to any renames. +# Thus, in the second collect_merge_info_callback() we can just resolve +# these two directories trivially without recursing.) +# 3. Exercising the codepaths for caching renames and deletes from one cherry +# pick and re-applying them in the subsequent one. test_setup_12f () { test_create_repo 12f && @@ -4803,7 +4805,7 @@ test_expect_merge_algorithm failure success '12f: Trivial directory resolve, cac git checkout A^0 && git branch Bmod B && - git -c merge.directoryRenames=true rebase A Bmod && + GIT_TRACE2_PERF="$(pwd)/trace.output" git -c merge.directoryRenames=true rebase A Bmod && echo Checking the pick of B1... && @@ -4884,7 +4886,12 @@ test_expect_merge_algorithm failure success '12f: Trivial directory resolve, cac test_seq 2 12 >e_Merge2 && git hash-object e_Merge2 >expect && git rev-parse Bmod:folder/subdir/newsubdir/e >actual && - test_cmp expect actual + test_cmp expect actual && + + grep region_enter.*collect_merge_info trace.output >collect && + test_line_count = 4 collect && + grep region_enter.*process_entries$ trace.output >process && + test_line_count = 2 process ) '