From patchwork Mon Jan 29 11:07:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13535396 Received: from fhigh6-smtp.messagingengine.com (fhigh6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7996A5D73B for ; Mon, 29 Jan 2024 11:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526444; cv=none; b=n87c1+jAHTRMcJehU24pOeigRt7/htOfC3YcKvU7iFVPr9b9jfUXRE7exSQUWTQHVcqAxFCyxDWWJ4dEXa//zBBiSZyoqsth6sUFwFjv6KuSjeyF3IzuP2gk53skmimchpkfevYKorF8uwM6CVo/6Yp6WCl771V0ufOPbxgaFtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526444; c=relaxed/simple; bh=WioqFTS8UdVasZeESmCML8utLS2fWfT00ORVIUou/ts=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DqssFZEzOxW1hXm3a4K84JvbVt7n3P40dv9fN/SWBuKFPDmuU4lKHR5dqNGEalP7+zxwNGVEQLwlJ5XU6VICaoXh2EgPZK8rz5vLpNKAlfN6d9PG1PyVWwV8EY0uiWtqftn7SjHsoX5ldZIEcV3qAYgZVUauSkoqyjo67I+MhRY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=MFfgMJCq; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VAHqqM/Q; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="MFfgMJCq"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VAHqqM/Q" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 4C8CA114009B; Mon, 29 Jan 2024 06:07:21 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 29 Jan 2024 06:07:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1706526441; x=1706612841; bh=bSa5bG/0GS HN6p+qWja4YQIOMoya4rQIx9eEmCQ0/z0=; b=MFfgMJCqTppouutlPqf+wmiznn HaNEBOeCLBqJVQ6RDkk8oynovY8f/ETGenyQo2NREF1OgLmz7RBLWAmSiYaVhiCM Sr3eqQIceppbWji6dBX5T95QV7HKqcN3tFBSm+s5ScVobwCXUOSIH/2+KNV6kwG2 0cYqX65C4clqgMU1nGJdwP8SejMKP8I6XLpT9FlMkYkjfVGQWeH6nTs0LudhfyDp VWDOyMpKZdbHFZftTNC7VpVdqdC3+UpPvm9LdhWkzvDDPHLxG2xFm5P/INvBzdsP R6ueBcJlRpQ+kypHYIBe26F1KVhQ8cSvhs9+guNvlCbxGqoeDY3bJLdYuolQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706526441; x=1706612841; bh=bSa5bG/0GSHN6p+qWja4YQIOMoya 4rQIx9eEmCQ0/z0=; b=VAHqqM/QWNWYvDudMoV28NVOh8MXFwULu2p2mvvAjaB9 fOSrkJHOMQfMdFonTmMDv4TMkwJZA9dOkta8edoOOK3BjOTUDG/tqEx2T4Bn4zFw CCYZ11sN66dQ7fDH0yZjGsblbmvQsfsW4EnAYl4rWBk2qp1LY9BrlLfayurAm3s3 KfgbuS9PaoiAtDmnOS+ZY8SDnn3AonRCJjGbUjFVvk/6l4LpOBzh+8JV2ceDh58/ bfWyPmRJXWa38pxeE+rJgXZvRnS1DkejXyBQM1ghsVafh+HCHODg8f/2d6gDPWkI OuXMy90JMmgqqTXJhZoWy/XwEfg3B4KFMIPdk/D07A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Jan 2024 06:07:20 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 44bfd440 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Jan 2024 11:04:03 +0000 (UTC) Date: Mon, 29 Jan 2024 12:07:17 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v4 1/6] t1300: make tests more robust with non-default ref backends Message-ID: <80a74bbb567de165a8dadf0664167140e4bf0504.1706525813.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: The t1300 test suite exercises the git-config(1) tool. To do so, the test overwrites ".git/config" to contain custom contents in several places with code like the following: ``` cat > .git/config <<\EOF ... EOF ``` While this is easy enough to do, it may create problems when using a non-default repository format because this causes us to overwrite the repository format version as well as any potential extensions. With the upcoming "reftable" ref backend the result is that Git would try to access refs via the "files" backend even though the repository has been initialized with the "reftable" backend, which will cause failures when trying to access any refs. Ideally, we would rewrite the whole test suite to not depend on state written by previous tests, but that would result in a lot of changes in this test suite. Instead, we only refactor tests which access the refdb to be more robust by using their own separate repositories, which allows us to be more careful and not discard required extensions. Note that we also have to touch up how the CUSTOM_CONFIG_FILE gets accessed. This environment variable contains the relative path to a custom config file which we're setting up. But because we are now using subrepositories, this relative path will not be found anymore because our working directory changes. This issue is addressed by storing the absolute path to the file in CUSTOM_CONFIG_FILE instead. Signed-off-by: Patrick Steinhardt --- t/t1300-config.sh | 78 ++++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 28 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index f4e2752134..31c3878687 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -1098,15 +1098,20 @@ test_expect_success SYMLINKS 'symlink to nonexistent configuration' ' test_must_fail git config --file=linktolinktonada --list ' -test_expect_success 'check split_cmdline return' " - git config alias.split-cmdline-fix 'echo \"' && - test_must_fail git split-cmdline-fix && - echo foo > foo && - git add foo && - git commit -m 'initial commit' && - git config branch.main.mergeoptions 'echo \"' && - test_must_fail git merge main -" +test_expect_success 'check split_cmdline return' ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + git config alias.split-cmdline-fix "echo \"" && + test_must_fail git split-cmdline-fix && + echo foo >foo && + git add foo && + git commit -m "initial commit" && + git config branch.main.mergeoptions "echo \"" && + test_must_fail git merge main + ) +' test_expect_success 'git -c "key=value" support' ' cat >expect <<-\EOF && @@ -1157,10 +1162,16 @@ test_expect_success 'git -c works with aliases of builtins' ' ' test_expect_success 'aliases can be CamelCased' ' - test_config alias.CamelCased "rev-parse HEAD" && - git CamelCased >out && - git rev-parse HEAD >expect && - test_cmp expect out + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + test_commit A && + git config alias.CamelCased "rev-parse HEAD" && + git CamelCased >out && + git rev-parse HEAD >expect && + test_cmp expect out + ) ' test_expect_success 'git -c does not split values on equals' ' @@ -2009,11 +2020,11 @@ test_expect_success '--show-origin getting a single key' ' ' test_expect_success 'set up custom config file' ' - CUSTOM_CONFIG_FILE="custom.conf" && - cat >"$CUSTOM_CONFIG_FILE" <<-\EOF + cat >"custom.conf" <<-\EOF && [user] custom = true EOF + CUSTOM_CONFIG_FILE="$(test-tool path-utils real_path custom.conf)" ' test_expect_success !MINGW 'set up custom config file with special name characters' ' @@ -2052,22 +2063,33 @@ test_expect_success '--show-origin stdin with file include' ' ' test_expect_success '--show-origin blob' ' - blob=$(git hash-object -w "$CUSTOM_CONFIG_FILE") && - cat >expect <<-EOF && - blob:$blob user.custom=true - EOF - git config --blob=$blob --show-origin --list >output && - test_cmp expect output + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + blob=$(git hash-object -w "$CUSTOM_CONFIG_FILE") && + cat >expect <<-EOF && + blob:$blob user.custom=true + EOF + git config --blob=$blob --show-origin --list >output && + test_cmp expect output + ) ' test_expect_success '--show-origin blob ref' ' - cat >expect <<-\EOF && - blob:main:custom.conf user.custom=true - EOF - git add "$CUSTOM_CONFIG_FILE" && - git commit -m "new config file" && - git config --blob=main:"$CUSTOM_CONFIG_FILE" --show-origin --list >output && - test_cmp expect output + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + cat >expect <<-\EOF && + blob:main:custom.conf user.custom=true + EOF + cp "$CUSTOM_CONFIG_FILE" custom.conf && + git add custom.conf && + git commit -m "new config file" && + git config --blob=main:custom.conf --show-origin --list >output && + test_cmp expect output + ) ' test_expect_success '--show-origin with --default' ' From patchwork Mon Jan 29 11:07:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13535397 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 122095FDA9 for ; Mon, 29 Jan 2024 11:07:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526447; cv=none; b=cpGOoYhbWDHe2vu3ysLgcdcowc8+oKPjbx0sFRA4510JZhxn2NspaiZIwINCTP5d4RZJHr+jSPMRJECix8vLptQmcV7eh8ZwZTueL5OZmB7GCzOHAFvg7jloqe14UBDB9nXe0RehBQrXAYYF4uP+zoRamXapC/bY0cCnVmkb6ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526447; c=relaxed/simple; bh=/L+9fvZitvCxdi+WK1Ra/3kEueZ9tN1D+dl+qpsGVpU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LqhYT/aK4czyZ3H+i5R4DKUg4WL1rJoLmVnvbTbqAQYRuB8yGqPizERQ6qKJCOJmmQzegGQdyAVdIfA6MjtP6P5NAq6lvKlZOkdq/+4kKM3gYb2OhUFcZ95v6SGkZ4aolhGNqLvAyjIdftU8dSP6q3LcRdGPsB0XZQjPX00pSKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=c2H0laM8; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FyEAgt7G; arc=none smtp.client-ip=66.111.4.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="c2H0laM8"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FyEAgt7G" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0B2925C0113; Mon, 29 Jan 2024 06:07:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 29 Jan 2024 06:07:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1706526445; x=1706612845; bh=HYY2k/I4Vp zFhrTLDAKc12qYuc3umrIgWE/z80yKuSA=; b=c2H0laM8O8bACHEmepYrHUELYR L9SBsGcfJc7Lv1sUnU6t1VE/WSyzmExWIHEUEZUfkZsk8Q8wa0BRXSi7T/RM11v8 tmbUuVW70htDPZ1qodN1MAC275k7Jw6krblN4GMotvrVg06zAWgDu6EFzq/qaj7e diq0dNTogR3r87ttcT4LpONjV7ZvsYRrWBbOnXAst9UZQKv4/JCounmLZP6sBd71 banRuOpufq7YUAKTbKratBr3Gv1poVjmCHoEBLwfk7o7C9nQ0UVB/9S+w97XZvHu CXFpGGHQMo8zdXKcnwv3IEWoNFZlkZ+GSmNAl1r0MUw7AbhhyVyMixhgiLgw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706526445; x=1706612845; bh=HYY2k/I4VpzFhrTLDAKc12qYuc3u mrIgWE/z80yKuSA=; b=FyEAgt7GJ5r+PpvIbTUGDNzVaBWDpN18LZ/XIcewKMXZ tD3+doE1S6hkW2KOPsX9SMHQEwtASCWEEObJzBu0ROyCSI45EKUtiNR5pFgDiHoh Rwd4z1apbItqbKP4BRZCQMNiLH2roUo0Ji2pV48BdJq3T9ARppApcqsLcSyMjhSd p7N7iBSKcUTPKvjRYqMNqPayahvAEkL4NAXtHr3BKkbPp+bvMaTmuAaVRK9wi9FA L3GQdC9FsNG2kBE2SX01J5Nz/2+8VlAhaiulYXMdaPAgGck7YJZrqTs7oiZoodQB CaCF8JMvviDIOe/s5EvqnXSzFAK8570prkpO52tOOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Jan 2024 06:07:23 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 893a2781 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Jan 2024 11:04:07 +0000 (UTC) Date: Mon, 29 Jan 2024 12:07:22 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v4 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Message-ID: <4359d3ffa816541cb68212714fa5d08e51138203.1706525813.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: In t1301 we verify whether reflog files written by the "files" ref backend correctly honor permissions when "core.sharedRepository" is set. The test logic is thus specific to the reffiles backend and will not work with any other backends. Mark the test accordingly with the REFFILES prereq. Signed-off-by: Patrick Steinhardt --- t/t1301-shared-repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index e5a0d65caa..8e2c01e760 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -137,7 +137,7 @@ test_expect_success POSIXPERM 'info/refs respects umask in unshared repo' ' test_cmp expect actual ' -test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' ' +test_expect_success REFFILES,POSIXPERM 'git reflog expire honors core.sharedRepository' ' umask 077 && git config core.sharedRepository group && git reflog expire --all && From patchwork Mon Jan 29 11:07:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13535398 Received: from fout4-smtp.messagingengine.com (fout4-smtp.messagingengine.com [103.168.172.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8469760267 for ; Mon, 29 Jan 2024 11:07:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526452; cv=none; b=aOS4zHm9aoh2bkfcNzkzcIatyaTM5QY4crD/tAnqJMXrUhLBuYnau4KleQrOdVMnTunwpDzPunJUZzJRPiDF2XY86bnAe/9uYVyQwRyylaZWho9AixV1Y3qAxWmbZBeb2Y6oEYvoKQr8oQEp3oObc4bC6uAa1fgDJWMqrlO1/To= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526452; c=relaxed/simple; bh=8WGLtC/++J3iWBOs7WWrCZbkQwYrv1ree8WU1RCcoYs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iShuENTogt1wLxVCdPIgPwimiFDY0EU+UBkar6OAXGVhv0o9xYlxt7L1n/SKc5Xqpsmjjf7vmHMvmfWEHt5LaaK18XxqNhx2a7O+RBm+GVH8E+OPc54MFkPcqwKiYQocFkDDadnK49gtXeuP49SbH0ekdSz2NmuGSqNHaMwpyhE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=CooDKsRg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=aP+4/VyX; arc=none smtp.client-ip=103.168.172.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="CooDKsRg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="aP+4/VyX" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 6DE45138009D; Mon, 29 Jan 2024 06:07:29 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 29 Jan 2024 06:07:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1706526449; x=1706612849; bh=ePpoFF20lQ 4DJXG+XLpNmLus7+/g9UrMMbgoqe4CVLY=; b=CooDKsRgpy6A9NbZEoHAP/kqLB DCZLQ7FKIv+rgBHy/wWmtORXSoD33ztO8jli20e5OcnbwZdVkxLH3HRkGflHvBEl uveIrJIvCSkv8oTk1rd9y3Ian8jeOxuAmItpl5ykJIp6+Ko7v2lQ4+/4mKpSzM8b bCn9pQwj+RyXANYemaPaZ6WSoViFqJ6dpIEGhX7Z0CBKZvAfsk6rh+Z44/h1Yt4D aflZCHQamUMg5IJNOd6DLQK2CF0k9ik3KTbAh1k6kcC50F/N/UFRpfNeW4jXgtRE qTJSoikWAgOkdragmgPCzuXKsSikrWd9kzN0lhJxr5fOO3L/9xwnTUoym7FQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706526449; x=1706612849; bh=ePpoFF20lQ4DJXG+XLpNmLus7+/g 9UrMMbgoqe4CVLY=; b=aP+4/VyXNZsSZAnXV4J0uieQdeLD7lViOxgWenlx66RC Ax4jpTpIDlRbC5CwE5AS+KEmXT56b5WDKEVyxPTJ4cv2IpdDMbDsgOgAA8xr0WxW eFetjfqZwFWHMWWdXcBxRF59vc4NaP31l4z/v6orLAgbV4CqIlMJvTGzRQr690Ic a0GtG+6ITjVvPWYBJnoHGKNoaS38HiV4hP8JeVuNXjP+/9scSZYtrHRld1rf6p+9 X+iRbSvn7tmoETOeKRR+jCugyQxyrI2+bewh3NKFddihdmP7AjB/K/zGo6qzb53P gxWPDi8KODt8KdLlu8ZZvC5bnqHmTA1NvHTu88I7Cw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Jan 2024 06:07:28 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id af9206df (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Jan 2024 11:04:11 +0000 (UTC) Date: Mon, 29 Jan 2024 12:07:26 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v4 3/6] t1302: make tests more robust with new extensions Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: In t1302 we exercise logic around "core.repositoryFormatVersion" and extensions. These tests are not particularly robust against extensions like the newly introduced "refStorage" extension as we tend to clobber the repository's config file. We thus overwrite any extensions that were set, which may render the repository inaccessible in case it has to be accessed with a non-default ref storage. Refactor the tests to be more robust: - Check the DEFAULT_REPO_FORMAT prereq to determine the expected repository format version. This helps to ensure that we only need to update the prereq in a central place when new extensions are added. Furthermore, this allows us to stop seeding the now-unneeded object ID cache that was only used to figure out the repository version. - Use a separate repository to rewrite ".git/config" to test combinations of the repository format version and extensions. This ensures that we don't break the main test repository. While we could rewrite these tests to not overwrite preexisting extensions, it feels cleaner like this so that we can test extensions standalone without interference from the environment. - Do not rewrite ".git/config" when exercising the "preciousObjects" extension. Signed-off-by: Patrick Steinhardt --- t/t1302-repo-version.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh index 179474fa65..42caa0d297 100755 --- a/t/t1302-repo-version.sh +++ b/t/t1302-repo-version.sh @@ -9,10 +9,6 @@ TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh test_expect_success 'setup' ' - test_oid_cache <<-\EOF && - version sha1:0 - version sha256:1 - EOF cat >test.patch <<-\EOF && diff --git a/test.txt b/test.txt new file mode 100644 @@ -28,7 +24,12 @@ test_expect_success 'setup' ' ' test_expect_success 'gitdir selection on normal repos' ' - test_oid version >expect && + if test_have_prereq DEFAULT_REPO_FORMAT + then + echo 0 + else + echo 1 + fi >expect && git config core.repositoryformatversion >actual && git -C test config core.repositoryformatversion >actual2 && test_cmp expect actual && @@ -79,8 +80,13 @@ mkconfig () { while read outcome version extensions; do test_expect_success "$outcome version=$version $extensions" " - mkconfig $version $extensions >.git/config && - check_${outcome} + test_when_finished 'rm -rf extensions' && + git init extensions && + ( + cd extensions && + mkconfig $version $extensions >.git/config && + check_${outcome} + ) " done <<\EOF allow 0 @@ -94,7 +100,8 @@ allow 1 noop-v1 EOF test_expect_success 'precious-objects allowed' ' - mkconfig 1 preciousObjects >.git/config && + git config core.repositoryFormatVersion 1 && + git config extensions.preciousObjects 1 && check_allow ' From patchwork Mon Jan 29 11:07:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13535399 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9436C604A9 for ; Mon, 29 Jan 2024 11:07:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526456; cv=none; b=qNo90t8XWu6dMXSS/dMMYAd0cnWZpSZDCPySzWyv+s5dyZY8wk0pHQ5IeO93L9Ut1UKea+CFDgrtAzgw+toV4QjdVjs4Aajc9DzPu1YFR78kpxWjcedJGNAusBTj26zxe870i/QhWEKQYIhSYlItwXppBq7mJa5OGY1Iw7Kqvd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526456; c=relaxed/simple; bh=ntfjAFz3M47F4GQu3erSD2IODFnNNCqHeU8x2SlSppM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iYjsq94ABc38Zkx4iedCPXW64O/wjvp24ETWpT8UJFhzZoqC3mk3HzXsrtcjpK6+Iz3MQHax0mwU+MqVcC6hnklYZcP5MB2Y4JX7ImyACFHyROyy1oHx5sTmlTtuoaMPrQME//z7HKXpWe/P2x1OLOj90hggRBTi8ZcCGJk6qk0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=Bsh7AvuO; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=EwzuXYX2; arc=none smtp.client-ip=66.111.4.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="Bsh7AvuO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EwzuXYX2" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DB4E35C00C0; Mon, 29 Jan 2024 06:07:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 29 Jan 2024 06:07:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1706526453; x=1706612853; bh=8+j06/YAai udvI8aRGXMYIFG1c3kLJAkNnalicSfw+U=; b=Bsh7AvuOSXWWNunkZxP0GAUGte 4JiHMpa+aYdNCzrUa2XrL7nWSXkVwi6Q310AnzPTjOjcm0CSl+w1Sxkew/fY3gQA 8MUUaKMCA2ufHXAuTe9r26r+RgHYKCd1nkwTTFNoWwDAeEbUN1da7+ImBnP7q7Fd EauKvaTy6hV39QMsLxW5+7RnBvMWT+iPa1tlkK7qpJyfqPbJESp1aaHppqwja/zy xj/THBM9/ixQoZp7P0P+ByLPpiuUGANNdiAarYAkB4fESrYGMjQWoldeU8SRLPti FP64yXTEv31fhr42YlK3iC3x1twBwLuuWNjAz6Q9l+dGM9Kw09FWsWLs6yng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706526453; x=1706612853; bh=8+j06/YAaiudvI8aRGXMYIFG1c3k LJAkNnalicSfw+U=; b=EwzuXYX2a9H8r0a2mSq1B3x3LtXa/jt7lHU6pTJkFCGm EsLKfJXLN8JzFB+h7D1mjWa+pGsHSTZI7hDOtd9erhmhyvGx3K/N9ZqlVnMuKzP9 q5CTfBjJhrPMRDRej+1sQOfl+dz9p6qFyAsAYk4cVaUgYgE1N+nwOg+7qcoLoJ5a E6wYPQn5QLYtDrsfitAKfs3/f83Y9PEKi0kmu4xvzCCJsJ4IvXvvvytgZUMT902q aXYKF8HRTL0yQCr7eIQVROQMvaEp6m5A95gaACocMUz2G6Yey+X3M0fnoqGS47sa L/BmIsdIUYh38nhFYHzyqBIOMTZpSHqjCGB3ZC0tKA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Jan 2024 06:07:32 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6cb32538 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Jan 2024 11:04:15 +0000 (UTC) Date: Mon, 29 Jan 2024 12:07:30 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v4 4/6] t1419: mark test suite as files-backend specific Message-ID: <1faa8687ae201a426e603cd456534775e314108e.1706525813.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: With 59c35fac54 (refs/packed-backend.c: implement jump lists to avoid excluded pattern(s), 2023-07-10) we have implemented logic to handle excluded refs more efficiently in the "packed" ref backend. This logic allows us to skip emitting refs completely which we know to not be of any interest to the caller, which can avoid quite some allocations and object lookups. This was wired up via a new `exclude_patterns` parameter passed to the backend's ref iterator. The backend only needs to handle them on a best effort basis though, and in fact we only handle it for the "packed-refs" file, but not for loose references. Consequently, all callers must still filter emitted refs with those exclude patterns. The result is that handling exclude patterns is completely optional in the ref backend, and any future backends may or may not implement it. Let's thus mark the test for t1419 to depend on the REFFILES prereq. An alternative would be to introduce a new prereq that tells us whether the backend under test supports exclude patterns or not. But this does feel a bit overblown: - It would either map to the REFFILES prereq, in which case it feels overengineered because the prereq is only ever relevant to t1419. - Otherwise, it could auto-detect whether the backend supports exclude patterns. But this could lead to silent failures in case the support for this feature breaks at any point in time. It should thus be good enough to just use the REFFILES prereq for now. If future backends ever grow support for exclude patterns we can easily add their respective prereq as another condition for this test suite to execute. Signed-off-by: Patrick Steinhardt --- t/t1419-exclude-refs.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/t1419-exclude-refs.sh b/t/t1419-exclude-refs.sh index 5d8c86b657..1359574419 100755 --- a/t/t1419-exclude-refs.sh +++ b/t/t1419-exclude-refs.sh @@ -8,6 +8,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if test_have_prereq !REFFILES +then + skip_all='skipping `git for-each-ref --exclude` tests; need files backend' + test_done +fi + for_each_ref__exclude () { GIT_TRACE2_PERF=1 test-tool ref-store main \ for-each-ref--exclude "$@" >actual.raw From patchwork Mon Jan 29 11:07:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13535400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42A525B5B5 for ; Mon, 29 Jan 2024 11:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526459; cv=none; b=QampE2elEn1kNinjy0lt89l/6MlS2t8urxRSu93Ub+0ZjXmYfWpWL/CQbtAXa3pKG2gUemuadjJqWtrfIrlw1lQCc2bA2dxr/PDLXslWa34LWOn7q0Svhk4qF0piSWuwWsnqtOn39dhnG1nYW8RkOLKRXWtHfOjpehnvF6wMtDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526459; c=relaxed/simple; bh=8TRzI0F857z3AIE8RJwf1MlsC5oPuf3+Iw2PAwCGmSQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VlxHd7okpl+F4j3omaG1Kgt6/AahGhyfSDzRcibJCYXdgVha1c6Ma1TDKRmBX6v2xm3kvEpkjQnUD8TxLO63QaKvd1GAF+fcj4/QBNjKaW3xKWjl4bUwavN1/wceiNL5Xa3GTiT0TQhwrXN/maobRdtR7YS/6xSldWu+T2SFDEc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=mi2HAuRT; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=yxxK8f1E; arc=none smtp.client-ip=66.111.4.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="mi2HAuRT"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="yxxK8f1E" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4BECD5C00C7; Mon, 29 Jan 2024 06:07:37 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 29 Jan 2024 06:07:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1706526457; x=1706612857; bh=hDj1oRRAPU mhJqG6ff4IYYaPz2Dh0+RJAc27M2KIhSg=; b=mi2HAuRT9Hyon694Y6eR7kDbYC i8kaZcjAW6/kin2Vnfp11Z+SjFmSLon2mign9LMTf0yMx2lpvCBgozyOQ/fz0/eK ahP+aBskY3mXz5dl21mt+uWc4dK07IdGc9Sl05eI3jd8G3iyeItQn1TWlQGVZ7HQ 6hnZKu4qyqDtmkC7lq0v28vzKabRiR46ohonSAneIMxpTrciepWejl/EThCDvC8N 1aL9THabT5edWo5JzZEbD8XeNsZUcC7cNHoocNISSbJZowlCymG17cvqVI5J1taL CKbxhCzjM5o7xxv2K8L1oaIhLlIDF4iW3rUweKkegVl7TH7mrnVIpeLQTJqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706526457; x=1706612857; bh=hDj1oRRAPUmhJqG6ff4IYYaPz2Dh 0+RJAc27M2KIhSg=; b=yxxK8f1EaUs1HQsWJORNSlXxWa3leIexULtgSiePWIGG kYEnFaIGOqTq1pg2bbpTCl+IHESMoHWqSHq7P0H0mu9n0T8LXKTjDbQtqpwhNbM6 NCVeIfgaIEgCA4iCMsc0dfuBcg0fLMGbvJIeQJ1iyJgsb3GPAZNNiltnbOdXPUAK s3cxMUGeHyudSWwU6voialPuekSOHBDz5ZfxYl/YUu4yYlEImMAFlc6SBBX5yzdE +BeBbVDbUnSGCen+ZmDv/Yj5VMibXlUWKWTyf/KO4AD6r8p3OWbw4B/67vND0ZDG VbmHEYRKDQgYrCMpP5XcXZ0F85AU5/r521VrCYoiDQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Jan 2024 06:07:36 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 358aa565 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Jan 2024 11:04:19 +0000 (UTC) Date: Mon, 29 Jan 2024 12:07:34 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v4 5/6] t5526: break test submodule differently Message-ID: <4b95277e2004ed2c60274ec99cee547129bd1eda.1706525813.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: In 10f5c52656 (submodule: avoid auto-discovery in prepare_submodule_repo_env(), 2016-09-01) we fixed a bug when doing a recursive fetch with submodule in the case where the submodule is broken due to whatever reason. The test to exercise that the fix works breaks the submodule by deleting its `HEAD` reference, which will cause us to not detect the directory as a Git repository. While this is perfectly fine in theory, this way of breaking the repo becomes problematic with the current efforts to introduce another refdb backend into Git. The new reftable backend has a stub HEAD file that always contains "ref: refs/heads/.invalid" so that tools continue to be able to detect such a repository. But as the reftable backend will never delete this file even when asked to delete `HEAD` the current way to delete the `HEAD` reference will stop working. Adapt the code to instead delete the objects database. Going back with this new way to cause breakage confirms that it triggers the infinite recursion just the same, and there are no equivalent ongoing efforts to replace the object database with an alternate backend. Signed-off-by: Patrick Steinhardt --- t/t5526-fetch-submodules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh index 7ab220fa31..5e566205ba 100755 --- a/t/t5526-fetch-submodules.sh +++ b/t/t5526-fetch-submodules.sh @@ -771,7 +771,7 @@ test_expect_success 'fetching submodule into a broken repository' ' git -C dst fetch --recurse-submodules && # Break the receiving submodule - test-tool -C dst/sub ref-store main delete-refs REF_NO_DEREF msg HEAD && + rm -r dst/sub/.git/objects && # NOTE: without the fix the following tests will recurse forever! # They should terminate with an error. From patchwork Mon Jan 29 11:07:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13535401 Received: from fhigh6-smtp.messagingengine.com (fhigh6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDF6E5FF1E for ; Mon, 29 Jan 2024 11:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526464; cv=none; b=oSUUtyylvRJLbkl+xNP1xH4392ZsYdMPKvHxr3GxTjttr0eJI25OsZvkgsQ95B8GTCO5v/YXwBKItmWUNkXN3hyEn4MpkaszpS8zUDX1g0ViT5morNDrr3QrHwYwrhpAbufAZsCVO8+ByjD5Llpi1BMQ6Fgo4mb2T1wKZA19YoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706526464; c=relaxed/simple; bh=iOYYorZj/B8H9xZYiefcRCXGBTi+WFz7xhF/V4FbI5U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gaqBqCcJCZF4KE1lGzonTOgc7R5Iqm+UcmrKHPXHxJN8hD8Rl/iBVy/ijSopXVXfV7jTjUEa30nZ70hKVgq6yuna3URB9hB9XJ7+YLy20su1j818v/7XxoKFVmEL9ec+LIRWo+GFKJSEHys7HyKeLXgAusj6VkoFcfwwINg8BZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=IwKVV1fn; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Lvg9TqkX; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="IwKVV1fn"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Lvg9TqkX" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id B70A5114009B; Mon, 29 Jan 2024 06:07:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 29 Jan 2024 06:07:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1706526461; x=1706612861; bh=Ja6PFkyjAH G3jJmvCXf+nI3vXwrz6JnSZNSEutvu8sY=; b=IwKVV1fnYWOjZke+OlUkfBoVGY JH/C6gJZPLChUAv06wWpjyIgVTwOf/YhwK14HxkQYNh1XI/eRzdJAYucE70IKrQv DUPkZif4T15rh1Ok9xb7fMIT/J7nxrCCLO8zE/QHVkZnSy2KuG0ZkRkXkfZcLpmq cqJ0Ki7pBMWzIxVsF23RfMPtwJi/fA+SsvxPAA8cknG7RlMjQmPiqylqBn7N055O APJoF/1k6CVNf3+7uiMT2nZ2tpv54PhMY7B2FoDmFgP96Ou9V/7FkCU2EWbrt3eo jHRhHycPomqRCj4Yj2jhOYm/LxSWPy7jdfUtfZ4mVtPlWWRzAKsGE4WL81Hg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1706526461; x=1706612861; bh=Ja6PFkyjAHG3jJmvCXf+nI3vXwrz 6JnSZNSEutvu8sY=; b=Lvg9TqkX0+uJP8ZwNBXV3MqoJN4F1mhYQ8XoJwhSlO5W 3aKh/1qDD9gF1MAhCVrzrL+qwVIa4XP1rk0YyCewPMEsYa6XSvqIngaVgVSemz8e YCfUXMnNUMztas6bcs5EVJyFCPL1g2reJSEt8gcexpN2yS1M5WUJ0hBfevjqIysx XHqWwWSqAJ2beWxXJzLoSbbYYVCWvk97pq1UiuRLJsTBRfdOoANDFJshgd7SYizB broz7ZS3lca3nnT9NscomavH+wVSP8vWYMHUBEnvdA1uJDs837XJvbBINp4d02Nt m4kvM3+ouFvdlzJLd7kAnGtoLaslMHw8iYDaR14Dxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Jan 2024 06:07:40 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 99c31da4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Jan 2024 11:04:23 +0000 (UTC) Date: Mon, 29 Jan 2024 12:07:38 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v4 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Message-ID: <53aea8236dbc515951c25b27cde65d948523cde6.1706525813.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Both t1409 and t3210 exercise parts of git-pack-refs(1). Given that we must check the on-disk files to verify whether the backend has indeed packed refs as expected those test suites are deeply tied to the actual backend that is in use. Mark the test suites to depend on the REFFILES backend. Signed-off-by: Patrick Steinhardt --- t/t1409-avoid-packing-refs.sh | 6 ++++++ t/t3210-pack-refs.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/t/t1409-avoid-packing-refs.sh b/t/t1409-avoid-packing-refs.sh index f23c0152a8..7748973733 100755 --- a/t/t1409-avoid-packing-refs.sh +++ b/t/t1409-avoid-packing-refs.sh @@ -5,6 +5,12 @@ test_description='avoid rewriting packed-refs unnecessarily' TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if test_have_prereq !REFFILES +then + skip_all='skipping files-backend specific pack-refs tests' + test_done +fi + # Add an identifying mark to the packed-refs file header line. This # shouldn't upset readers, and it should be omitted if the file is # ever rewritten. diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index 7f4e98db7d..c0f1f9cfb7 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -15,6 +15,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if test_have_prereq !REFFILES +then + skip_all='skipping files-backend specific pack-refs tests' + test_done +fi + test_expect_success 'enable reflogs' ' git config core.logallrefupdates true '