From patchwork Wed Jan 24 08:45:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13528804 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 8E10617980 for ; Wed, 24 Jan 2024 08:45:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085912; cv=none; b=sm+tzmCUsBoJmGx4JK8wMr5GlVBXezqV6MLfhg8O5b0Vussb8g+CDUjnuFVEgrw3+/h4OeRU6xfaIG/TaJOrIlaPyIf/fgE+sHfidA2zKBMCY9vuesLEoxU1sK7A5v8kl94QLYa9f2b+1TtN/t1Gl4aeJqZjl8ECAtJ9pBcgla4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085912; c=relaxed/simple; bh=yY8sAq93md3ovEdK199ktE9uN37cL7Xpzn9itEZ1sQk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=haQFug5l4Q8AJwnIhZ66VrK3dcvCJ2jSjIe1mojVSFIEUh3TAOhuQoaqhuDjV2ghYXeVWaMzEYs2KdVNT5yJyPLOiAlk4Wrjh3R3bu1ZKaAtmip3VQ6hvKeTMtwjMm3oF3qDlVnfyleaGTg6iTIJcSnxqU2WzX0F2s8JcfOA2k8= 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=a7j/DcgK; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=HGWQbPzH; arc=none smtp.client-ip=64.147.123.19 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="a7j/DcgK"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HGWQbPzH" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2C29A3200AED; Wed, 24 Jan 2024 03:45:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 24 Jan 2024 03:45:09 -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=1706085908; x=1706172308; bh=CQtudOrNcu QNHGXuMzSQwV4QGeDoCOOxLXNQjCpsha0=; b=a7j/DcgKizyFJ3qXCkv6s6XNYv nhBOR1bl8ip1g+ByODFOh+xU7Sa/F6xON1a62S2mfyQSzNi/AcwoB2KvhKwKhAzm APagPAWCmKJCzU1mWz082uOod47uFSF/bUb/PJODs+06viNemJiE1KUGolDM0o8W FERVfl4AUh5bUiI+1VV2vhFyjTm8QpAj+X1oZh6dgkNND4kBobCGGHD3NinXXMRY dWM/6QX8ALsY1UHW7HBdZDQkkNKKVfYPeuXziedszUU3v+xE/pehoIGkDJJkwiYx Ip3iUqgGu9jT5lVodcZWp567EP85KGLTaGKrjnpjWPawjEmeCLmjUmXRpzgg== 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=1706085908; x=1706172308; bh=CQtudOrNcuQNHGXuMzSQwV4QGeDo COOxLXNQjCpsha0=; b=HGWQbPzHToNYHCbVbWeAyHEShtEneuWAqdFg5PoEUUiv U1zGiGdI4XjinQQT+dKVNHN5FzakQISRSESrR9oQ8ja0sy6mtzejT2G0p4/cL6Uz qcMpqGBDVTk7ZLbYWfUf/qwcuhEqjY2YuvXFaYRU9ONepgNp2jLbQhHbTsW3GEI1 yyjngaXnRF17mW4Dmsl6jqTGZQlL7gehQvje4NjxGeDqF9/auTGROO516FGOvuza aKzgaCZ22zXNEFQs0Ka9kMJ9ZQQm2hh1vid3YxKyrPH9JDggQcxrD02ouFJyTw5f Vl5GyJIQNKxlKvQnyt4TDy1EoQ/fcn7L/FnnTV3bnw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jan 2024 03:45:07 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 23b38d73 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jan 2024 08:42:01 +0000 (UTC) Date: Wed, 24 Jan 2024 09:45:05 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v3 1/6] t1300: make tests more robust with non-default ref backends 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: The t1300 test suite exercises the git-config(1) tool. To do so, the test overwrites ".git/config" to contain custom contents. 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. 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 Wed Jan 24 08:45:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13528805 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 1EEFB17980 for ; Wed, 24 Jan 2024 08:45:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085916; cv=none; b=J5sQyuFd37dBg07Z0OrKXDrDpdrGUlfPhX/AA1eSR5COL51GrRSnubELXIKM8VHtzYLlCgmL5AgJIQ0+uIrQKkG5JGxhJY90/bEAaaIL2GML96zdpu58WtkwnCdRW67nLm3k4C75fEovWL15n+SGoqyABpXC/UKgQKAlsIpsQNU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085916; c=relaxed/simple; bh=LtW13U2VmlTsHGQsnt7YR3Ruzm2U7f1dOnU+x5CLoQ8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ouvA3TltE4Kh+LupMFJb/6ZjI8M8AamRDo5yWw1LWUpr6KvYD+uDL45FqNhkTs1iCQMBz2hqe7heRhA9w+sL/UItHbS9G0jH1aA4JYqypE6IWczz79g/0ft296CFYmH0hytih7ja050HbJTim2SzIFSzsjCwKR2Bzh4TcJwl2TY= 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=iS5WJ/6T; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OI32yg0z; arc=none smtp.client-ip=64.147.123.19 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="iS5WJ/6T"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OI32yg0z" Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 179063200AFB; Wed, 24 Jan 2024 03:45:14 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 24 Jan 2024 03:45:14 -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=1706085913; x=1706172313; bh=EZ8jZgIsKV 7VNtvWnvVvY5QB5O4qCYBdwhN0u3d2+7Y=; b=iS5WJ/6TJM6efHQYsyt2LPIPgp CZmPXdDaws0vhrJt0iLDdr+I/bdrNF9zaQbVka0OZjOAB2XQ1rnBCK7yJ0FcG5/I 95YRRr6sWOwLkeFdmGc90gjq+J54bXhhkvPE+mFLqv9JrhWYhSok+1jS2rA+TUMz JKcAOL/HYYU3Pgb5LRoiI0NT4GfEt9LuUDycUUO9zDhZbEFZHcQ3Omd9QadNCs55 32BrKGLaRcDhFD6UrZ9EeDlMT/Q5+NusrcVqRfVuLxS177DkxQRtR+OHesL0xr46 7/NPL/L9gx3i2Wq3VDW+vczjsL0FUmicWGQ9fzgqir3CZm/I4h0wWuiXX8dA== 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=1706085913; x=1706172313; bh=EZ8jZgIsKV7VNtvWnvVvY5QB5O4q CYBdwhN0u3d2+7Y=; b=OI32yg0zgnM+ruOhIvOPNhE1zGVbhwB4uXynlfQjx3cO CwzsTGP6J4Ihb22ivOG5ganDD+arl9aaNNO8aAl4NszyevaZ50Cba1U+EudcT+lh hz5t5LMZ1wIctfzNcdcT9BjN7XkHzXXEGeA4cMqVU1/wENt4UJmJTlmMSdJSpoul p4ATWyrd1HtOktEPdesqz+J9WpgV580GdQ6A9UFchGyLqfUZWms1lFNXN+7argKI 0ZLBBYigK9sJ2Hkx5CzTW+xzkvUzUKX7Al3uh8HWd2uScfhG6we3JgdBM8jzeT9m m1NOrnlP/6DS8kHwiKn4EhEs8PJ5yZ5KkuvTCtWyCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jan 2024 03:45:12 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 5ccedd32 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jan 2024 08:42:05 +0000 (UTC) Date: Wed, 24 Jan 2024 09:45:09 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v3 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific 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 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 Wed Jan 24 08:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13528806 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 E575F17BA7 for ; Wed, 24 Jan 2024 08:45:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085920; cv=none; b=mSCPsUAj3+oniGjLO4JrGkTGX4uHKcIsdxZUikh6ByTUvg5AuulEzdWKYdWHHaxaqST6ONSNUs4Pu0EkeUFz0xbh9jDorU0EtIbbaQn6HfG3YfTdKWe8Ccu6B7Bo7i3+9C0moASc9Lknvz3fsVKBgl9HQAF1YPPoXPzRcW0sP4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085920; c=relaxed/simple; bh=sVk6RHTOHgVv7eXOkfQdo+dM5q9krh+FP1KMYcsopzQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jdGkgwaQWCAn+2zR11Yq65vcvHKDaML44BcZEjvQCBg1bIbBpoabfECyiVRu9hnKbMDrOytBOr0vriUFohJ9jAEMKNNYLGGQj7zc/0a+vDPuIetoNhP/diDkMJ6eU5WUEPKAkFlGnhqxN4M2poiRk+iNbYS+eoDxqD+gnlbA0iU= 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=SUwdcNzg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Sg25j+ef; arc=none smtp.client-ip=64.147.123.19 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="SUwdcNzg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Sg25j+ef" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id B3AC53200AEB; Wed, 24 Jan 2024 03:45:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 24 Jan 2024 03:45:18 -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=1706085917; x=1706172317; bh=28kkoTR9hx Fd+b5burZKsFuLkbASjrfM5ha9ImfZW+4=; b=SUwdcNzgApFICQZyvnX3/2856E X+ETs8tyOab2Qj0rOdIbexoryfzmChaW3h0BsPklwXmTrLVeVfAHRHw4vve6Bswo kLtm26VG8sYju5h6msPhjULCMhG7Pl1pj1dc3SBSi0YesiWp89JlwV74sTs/zDJD Sf9gbPnheUGi1AmRFlS/AyTkjdq8aqI9Nv+yuqcZfADWlxgcnl5+U+K6XXLR4gic zKX6DCkcN6KqwIfTSCzEnCnByJUhL7jyaKbbk8WCvd1RC4XapqOkI1GZkPmoMDeI EKAd4Bq7wYprzhgX/EntclX/+z0GnmZr/Pv+YLZAvJ9xdbSmmU6fxKiDZ05Q== 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=1706085917; x=1706172317; bh=28kkoTR9hxFd+b5burZKsFuLkbAS jrfM5ha9ImfZW+4=; b=Sg25j+efGOFuI+fWpbTtpEWMXc7+bqvb2mJI6zWjdwlA UOEg6e0ohTFi+o0zYbOs86ke7ERyN9MWq3EYh9EsfRqIYScioslaFuyhqMJzm4QX 1ZAWsIaHl/1tsODqRf6ScVzHPwBIlmwWWEpXZKto0fWC/x9KRnemIv0LEBWDcErr yGbG9a8E7QzAgSxhlqRBBjkiIiM3Nt0e1aiPGNWKrpB+ZLTB1Fw6uuYZ37+e+vFH qFj54rht5pbLyQXtimHe4wbKyjqWBTc/IrFHEkxRJT1ji/H8RdUAPitST4WNN1QY 7Vu1ZEZ0TwkSK2wA95EEFwZZWBYwGafYcUxUbP199Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jan 2024 03:45:15 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id a427360a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jan 2024 08:42:09 +0000 (UTC) Date: Wed, 24 Jan 2024 09:45:13 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v3 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 Wed Jan 24 08:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13528807 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 85A1117BA7 for ; Wed, 24 Jan 2024 08:45:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085923; cv=none; b=iFFyR0HTOxbJfsNCrysSECmg7l4a+MB3T6Y1/NKlXSBwxK0hO798YVQjZC383rorJz/TFkio6Lo2b4x3AjecUMviAM0HWL44VOf/HmLyt7QD9XIFIXT3IdkxYztNLb5I2H/qVGeIiVUWtjQnlfseo7q9geY3PVAtfG6dY2kr/ms= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085923; c=relaxed/simple; bh=zmrDUjBK5c7fykf7U/U1qFg3JqSkYlm7daF1YoUfUig=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=stMuDszX7uJUbQCMJCPfotN0wsLGcj9CLnImV4Y7Vb3bN1TtWUhCqXeimXJbFEdzZtYbAIaFdTysAX5ngjmkY3na6I5miGXeISvoo20PvxMhrxNgT9MIdKryqeIqb6e0uePV3xAbRMagb6u0UbDMkMOZnTo7kCaVpOdJD0G1jfo= 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=XxEFSM8K; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ICwthGfJ; arc=none smtp.client-ip=64.147.123.19 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="XxEFSM8K"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ICwthGfJ" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 65BFB3200AF4; Wed, 24 Jan 2024 03:45:21 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 24 Jan 2024 03:45: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=1706085920; x=1706172320; bh=74P3FhOlAU MZfr/nd8aURIExKvc24D/TaOswH9k9aCo=; b=XxEFSM8KwqIbrRYTwQl//usJ+D C4ctZTZu/5iBSiATeBq98z+qVlpfJ7GV/n64ZIUIRowr8JCQ4H2qF8jh4C71taV7 RwmPflLUiNQAJUsEkVgyxYFbUCMywwm0aJ+XRiie5cGYd2OO1HRmautN+qlowpj6 HEl0oDfgpHiBRAbFDgnbnYxk7SuN21Zy2tKKRn3rjn0l10UsRBjMAbz7HR13VCqr 6cy1zrfI/kaBj0jg/DxBlNAeIm8F2EC2crHfHODSmw15d9jfeR2XewnQ1FW2DPAe BswVVuU+I+UopMl//t3OnNq1KQ71Z7izzZ/5mGv8ixzzKjewnMFUSEnEugXQ== 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=1706085920; x=1706172320; bh=74P3FhOlAUMZfr/nd8aURIExKvc2 4D/TaOswH9k9aCo=; b=ICwthGfJGtYTGxqftMN/mAEQmeyzwLeNBM3QP1sWzZnd siQ9dQa2GaXuSDM7kpKNIMJ/D5gP/ALnL4pjn3gXqlDy7lI/QOoPGid0dtraZkLy Sb70ZcYhJAbbtVgS6+vwr9s+bVXNqg6idIpmh+/1diUs9H7I/CtUVIXCumMS9n46 gYqJ8gZ/WJVYHvlbMFBXsAbCadaVqVLEZ+rRyNwRYHd/95G+DdyevK0pE6gb17/Y HgCMty4nWjGTXuqzHMvrZjOSCvTeiFt5rH02E3NYazGXWo21LeDC3gPydVb1Ogx1 ou7EviDSj23AW3MbskyvRk1VgSpCMtyYBxSzDptBcw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jan 2024 03:45:19 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 2725060a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jan 2024 08:42:13 +0000 (UTC) Date: Wed, 24 Jan 2024 09:45:18 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v3 4/6] t1419: mark test suite as files-backend specific 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: 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 Wed Jan 24 08:45: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: 13528808 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 607DF179AE for ; Wed, 24 Jan 2024 08:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085928; cv=none; b=LcQA5bNll1RzRT/pbcHHljR75XE8L1XHtxfAWJ59RtXQn7/Mmjf+F6Wc1nOybMPd1grcXpo8IuNttZsCphGgC/EboOF2AEyqrU/bxrxEs6st0Cnc4HeKFWFlxf/y/MJufLsjaq2hVbTZhL9xf3c0o3fCjRujyyZ4srKanKSaaMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085928; c=relaxed/simple; bh=a0tVLvUtwSccFMb8l8rQ7S6RbEmcje+68eVUSUxvvLM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ezI6zEDV0+/gp3DZaGW9YiINjBo6z+iURA/WxtzuxE3m3oXERQ1AfJnNyHQCTvv/bQIxxBJxaRqWB8JSAX8FHqHusmFMJ28ti0wuf7zOqr4C9r/8AXsEAqASYuIxsC30LmmxSH80v6mCs2vrDNinMvrLPbM4SXqsus6pMpNHlag= 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=n2eJVIhg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Z+226RYL; arc=none smtp.client-ip=64.147.123.19 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="n2eJVIhg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z+226RYL" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 1AA213200B0F; Wed, 24 Jan 2024 03:45:26 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 24 Jan 2024 03:45:26 -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=1706085925; x=1706172325; bh=JyKQhLzkkU nYfRIeexj7pOoilWsMmqIoJlA7eOvWGk8=; b=n2eJVIhgUlUXOqx+B7EiVV02/5 5yDPRKJpJ0MwV/SwmI05aT/Q7bwlI1l62HtWWJKjF2U7+JWmFwW48GRqnzCicry2 FZza4x4BQpstmCo/qrg/gveAxWgIeGbVIzlXYTQ7RKYjVCBZ15CS1WKJETZL/GC1 gHAkYHpo2NOaIkmnw+bfiTY3J9k0ivtgd9r/pYdqD1jc6V6S+m36J8tOnGzuPKj6 Fb2/mkhXzBSr02nmr6VkyOihYEhRSuOZWX5Id07XaRNH0xYWNSKu9QbKAi/Hdxzf PHRbHuwyf4pDw21IiBlVW2lyJh1EBKCyRjQsGawiiZeX+2maNsXJ1mePPytg== 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=1706085925; x=1706172325; bh=JyKQhLzkkUnYfRIeexj7pOoilWsM mqIoJlA7eOvWGk8=; b=Z+226RYLTBe31xBXEhtcTAmMF+gxvU0Jz0/dY21/jq/8 9dpECweCVKkneifRvjvljuT9Krj7ure/LVDMpqsOUY2aawO3Yrdv5am6vTajGIKT laF1Bdb16uWn5Fpun9jZIx8bI6EC3xPQPhOLDCN+4A+awcBYU2z55CbFnSQ7QF07 fgracYs28FZE1wW21gujMlSBMvDWwZTXN2KfM2Bzto5lOwkBeOojlEHMDNB/0GVQ YhG3wa3NELVqOU47MV6jz+Rtss2r/zcBtZdVQoh8vcDwEr3qIVLHHbcslx7LsBKc ZwchhP3VmIOptGvrUD3V175cMT8h/7zmJJXNwThe5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jan 2024 03:45:24 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id df5013da (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jan 2024 08:42:18 +0000 (UTC) Date: Wed, 24 Jan 2024 09:45:22 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v3 5/6] t5526: break test submodule differently Message-ID: <066c297189f6e09ee9f0defa9998932d8072c854.1706085756.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 Wed Jan 24 08:45: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: 13528809 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 3046A17BA0 for ; Wed, 24 Jan 2024 08:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085933; cv=none; b=Fcmj3xQLRmmwkn51UwZdJwcp2jUgn6hpbecM+j+a5ktGgiCsId16uQCdSzF1E4k91j/5wLckM27FIW/ePQWz3HhtU5BalZrm9TVE1LSxbgOwlSHRgB7TWwI+HGOaOxzusIyMxYabPn78eRsL7I9WaivbVltt/Y1Vyi/jIzKtEPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706085933; c=relaxed/simple; bh=5A/vlKQ12yBgyfhhHzl4d/9BhTLycgXv5TBsAWLKr/s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HCFPyoIHcSodzlo4OO36hd9GwN7cYKfhueLntPs5p6woe6iBtR1vwTttp2sXt8RcD9y6c5rCfpfbJo3L+XWkAOkTzOWe2x9GT/jamTjGl999x59HpefELGvWHiK5u2YQSCDWq2OQV4unqPlwSwzzsrqxBBdZoVkJHtx3OJpfmlc= 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=KdVRAzSN; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VfiCDRQ7; arc=none smtp.client-ip=64.147.123.19 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="KdVRAzSN"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VfiCDRQ7" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id CB6D332003F4; Wed, 24 Jan 2024 03:45:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 24 Jan 2024 03:45:31 -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=1706085930; x=1706172330; bh=7S+DcTF15S zTSYbMSG8VEOEKvM58vGeiUjkx/0Y63zE=; b=KdVRAzSN7QypFVMDCheApuO5Ns X5ptEZWhQsftGMYboGEHuu69SVQOtkbTCAl8CLWEGx1M1elRx8e6hH2UWTh+m+j9 hY1VLpcj2H1oaonquFDHpg56KPDjw92k3RTfBpiy9q3Aw16W138ldfvX/UDbDLQ4 FPaWs3cNYSjzqZVw7uqZWIM49RKo40mt8hDuZFNHJFmD3vUvZ8ESrOq3y4LJlpv2 VapDSthoEfn/q4HN6ofCxVBi722D1F4bhV/bSJmsWoZtFnKpkSPQztqcMxY3LDkl xMG3DB6hm41c8VmWDN2bMNhdLgP3oCl+W4xJBlnaIxwagJZxktDBhx/qUpag== 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=1706085930; x=1706172330; bh=7S+DcTF15SzTSYbMSG8VEOEKvM58 vGeiUjkx/0Y63zE=; b=VfiCDRQ7uoWcitN3ORx+WNph4w7kpgQfGGfOaLGM2IHz wz/PUh4DJaNmv0tvXGO4VzxxWLGwGs461tl6mhQijShnqLALNYin6QV+gb/9b090 Zgr6OrSAQ5AwB70SXsXCsXU1Bv89r4ZlRd76MSRUpG5h6yvgGu8epfJqWoahKYnw nEiV1X7HtQHuZrRpin+kpbhusDcExL2wCuyFybuE7FmJmoEkGmgr/vqkrJAi7rkP o9IdRfBFWdtVS6Cp9fDMoIyQLylWkymU8K/7whw38RUQlrqMyD2Ixlxw2/W9aqJ7 0iyMCQU+PcJRwE0r2k4S4rUHHQXJWS6e77UAsKFR6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeltddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Jan 2024 03:45:28 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id d511aff8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Jan 2024 08:42:22 +0000 (UTC) Date: Wed, 24 Jan 2024 09:45:26 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine , Toon Claes , Christian Couder , Justin Tobler Subject: [PATCH v3 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Message-ID: <7b8921817b14df7fe3346f89c84369df7403ddb0.1706085756.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 '