From mboxrd@z Thu Jan 1 00:00:00 1970 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 15D37CD80C0 for ; Tue, 10 Oct 2023 12:39:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231663AbjJJMjK (ORCPT ); Tue, 10 Oct 2023 08:39:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjJJMjI (ORCPT ); Tue, 10 Oct 2023 08:39:08 -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 267D3A9 for ; Tue, 10 Oct 2023 05:39:06 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4066241289bso52536965e9.0 for ; Tue, 10 Oct 2023 05:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696941544; x=1697546344; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RdB2Sfx5tjWkyK8+Qlv7HGdfiXikWTmSCmIKvFTl0AY=; b=gtSVegxM4bv1iH8arKjKC0bzK3As6XMhKKaiP932muubxSkzZ3BzO201B/+DOHaN4g Y+2FNFjd41A6hHUUlYAgc4Oh3A+3Tl45sisIgoSISJyuu/eyULCep2GttNEfwA0oZHcd 20UzAyikbHf8lB6zZsD6LUmhKCEIHM0uTQ53P2AUVLWA0+3uhThvK3S2lrzqaBn/j4cy nVCran8bbeGAtTxp2QIy8u8DYxVHl7yFEJ8/d8C+oHGwY5nx/YTnM4dQWqQXgZrw2JgT +EOyV44KC7ACpHQAlJqVB+APh6tdQ1cQK3CZgvQ2lSZsE2L68md+pDci8WCbYSL3GFiU 21CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696941544; x=1697546344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RdB2Sfx5tjWkyK8+Qlv7HGdfiXikWTmSCmIKvFTl0AY=; b=asvqf0Vx/Kt5UGapnHnk48STsLY7j9RooPeOXfu4eQ/c/zAb0IGPwrsPkMzeTtMdgL pLPyeoskl5/wtxwlsCxbWx5KkpCtS+wdjRKXPJSMJO2kqbhsxvL56T3vKPslRP3TroGy gWixiQx1KQ9xSaJb53eAwE6Irx86/oXBXrT4+A063/VeYBSHrpcEdHqMRsGvdkO0nuJ5 +DcelkuvwD0l2fFx64uo3gmMfpQk9DSgjL1vb0P7TKCnIUov/aYu206oqG6j/+51KP1x PflKy5YS0wLR4sKnUHBd5/SviWagv9hdbhx0oRoUZQTWR0A1QfT20LiVnoxBRqjiCBKu ANSw== X-Gm-Message-State: AOJu0Yz6s7vnzcNlFezEyWAJvkBWFdMsP2L9kC6ZcTKIw2j/GibXpX9l CUC/awvF8+bQUW7eoUtcLu/wdzE9LNu6aQ== X-Google-Smtp-Source: AGHT+IGP2PvrVW5JDmOfmBPteCvr/o7BM8iquL7jy+m7ZSRyFHzG56VQDKntWW75XgFlcQCUuzfJDQ== X-Received: by 2002:a05:600c:c8b:b0:401:b2c7:34aa with SMTP id fj11-20020a05600c0c8b00b00401b2c734aamr16091082wmb.33.1696941543934; Tue, 10 Oct 2023 05:39:03 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3f04:7ca0:516d:299b:cbff:be05]) by smtp.gmail.com with ESMTPSA id p15-20020a7bcc8f000000b003fee6e170f9sm14071689wma.45.2023.10.10.05.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:39:03 -0700 (PDT) From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Patrick Steinhardt , Johannes Schindelin , Elijah Newren , John Cai , Derrick Stolee , Phillip Wood , Calvin Wan , Toon Claes , Dragan Simic , Linus Arver , Christian Couder Subject: [PATCH v5 01/14] t6429: remove switching aspects of fast-rebase Date: Tue, 10 Oct 2023 14:38:34 +0200 Message-ID: <20231010123847.2777056-2-christian.couder@gmail.com> X-Mailer: git-send-email 2.42.0.339.g663cbc8ab1 In-Reply-To: <20231010123847.2777056-1-christian.couder@gmail.com> References: <20230907092521.733746-1-christian.couder@gmail.com> <20231010123847.2777056-1-christian.couder@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren At the time t6429 was written, merge-ort was still under development, did not have quite as many tests, and certainly was not widely deployed. Since t6429 was exercising some codepaths just a little differently, we thought having them also test the "merge_switch_to_result()" bits of merge-ort was useful even though they weren't intrinsic to the real point of these tests. However, the value provided by doing extra testing of the "merge_switch_to_result()" bits has decreased a bit over time, and it's actively making it harder to refactor `test-tool fast-rebase` into `git replay`, which we are going to do in following commits. Dispense with these bits. Co-authored-by: Christian Couder Signed-off-by: Elijah Newren Signed-off-by: Christian Couder --- t/helper/test-fast-rebase.c | 9 +-------- t/t6429-merge-sequence-rename-caching.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c index cac20a72b3..2bfab66b1b 100644 --- a/t/helper/test-fast-rebase.c +++ b/t/helper/test-fast-rebase.c @@ -194,7 +194,7 @@ int cmd__fast_rebase(int argc, const char **argv) last_commit = create_commit(result.tree, commit, last_commit); } - merge_switch_to_result(&merge_opt, head_tree, &result, 1, !result.clean); + merge_finalize(&merge_opt, &result); if (result.clean < 0) exit(128); @@ -213,9 +213,6 @@ int cmd__fast_rebase(int argc, const char **argv) } if (create_symref("HEAD", branch_name.buf, reflog_msg.buf) < 0) die(_("unable to update HEAD")); - - prime_cache_tree(the_repository, the_repository->index, - result.tree); } else { fprintf(stderr, "\nAborting: Hit a conflict.\n"); strbuf_addf(&reflog_msg, "rebase progress up to %s", @@ -228,10 +225,6 @@ int cmd__fast_rebase(int argc, const char **argv) die("Failed to update %s", argv[4]); } } - if (write_locked_index(&the_index, &lock, - COMMIT_LOCK | SKIP_IF_UNCHANGED)) - die(_("unable to write %s"), get_index_file()); - ret = (result.clean == 0); cleanup: strbuf_release(&reflog_msg); diff --git a/t/t6429-merge-sequence-rename-caching.sh b/t/t6429-merge-sequence-rename-caching.sh index d02fa16614..75d3fd2dba 100755 --- a/t/t6429-merge-sequence-rename-caching.sh +++ b/t/t6429-merge-sequence-rename-caching.sh @@ -72,6 +72,7 @@ test_expect_success 'caching renames does not preclude finding new ones' ' git switch upstream && test-tool fast-rebase --onto HEAD upstream~1 topic && + git reset --hard topic && #git cherry-pick upstream~1..topic git ls-files >tracked-files && @@ -200,6 +201,7 @@ test_expect_success 'rename same file identically, then reintroduce it' ' export GIT_TRACE2_PERF && test-tool fast-rebase --onto HEAD upstream~1 topic && + git reset --hard topic && #git cherry-pick upstream~1..topic && git ls-files >tracked && @@ -277,6 +279,7 @@ test_expect_success 'rename same file identically, then add file to old dir' ' export GIT_TRACE2_PERF && test-tool fast-rebase --onto HEAD upstream~1 topic && + git reset --hard topic && #git cherry-pick upstream~1..topic && git ls-files >tracked && @@ -356,8 +359,6 @@ test_expect_success 'cached dir rename does not prevent noticing later conflict' test_must_fail test-tool fast-rebase --onto HEAD upstream~1 topic >output && #git cherry-pick upstream..topic && - grep CONFLICT..rename/rename output && - grep region_enter.*diffcore_rename trace.output >calls && test_line_count = 2 calls ) @@ -456,6 +457,7 @@ test_expect_success 'dir rename unneeded, then add new file to old dir' ' export GIT_TRACE2_PERF && test-tool fast-rebase --onto HEAD upstream~1 topic && + git reset --hard topic && #git cherry-pick upstream..topic && grep region_enter.*diffcore_rename trace.output >calls && @@ -522,6 +524,7 @@ test_expect_success 'dir rename unneeded, then rename existing file into old dir export GIT_TRACE2_PERF && test-tool fast-rebase --onto HEAD upstream~1 topic && + git reset --hard topic && #git cherry-pick upstream..topic && grep region_enter.*diffcore_rename trace.output >calls && @@ -624,6 +627,7 @@ test_expect_success 'caching renames only on upstream side, part 1' ' export GIT_TRACE2_PERF && test-tool fast-rebase --onto HEAD upstream~1 topic && + git reset --hard topic && #git cherry-pick upstream..topic && grep region_enter.*diffcore_rename trace.output >calls && @@ -682,6 +686,7 @@ test_expect_success 'caching renames only on upstream side, part 2' ' export GIT_TRACE2_PERF && test-tool fast-rebase --onto HEAD upstream~1 topic && + git reset --hard topic && #git cherry-pick upstream..topic && grep region_enter.*diffcore_rename trace.output >calls && -- 2.42.0.339.g663cbc8ab1