From patchwork Wed Jan 10 09:01:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13515789 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 436C83B18A for ; Wed, 10 Jan 2024 09:01:43 +0000 (UTC) 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="nAwWHAJP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="SDheBZET" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id E6CE43200B5B; Wed, 10 Jan 2024 04:01:42 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 10 Jan 2024 04:01:43 -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=fm2; t=1704877302; x=1704963702; bh=Y6HLE5aSm9 NwAcCLWMhOaAx/cwlxZcrNkxEkJu+qppg=; b=nAwWHAJP/cMLCWLNk78Wys0QOs UjeKfIUVzDe4HqsVi1/390qDLebcUoXmp+ILPSUOmS4d6ihOVm2Z2d5SKDq5/oHe hlAN++teJQ0nLL0fyAop4iL22HxSmZ40Exe3gTDKUn+y1msDfqny/pfRuW/5vV7S oXxKd8FdDtgejZvHKjHVAtZwSrs4hrSDLZS4D3iJCjhTdqj6VXjwUsbuHXLOY9gT qs2o3ttV0k3GfyWvPf96ISczr4lEOMY8JCKUxcj3Y1dgoBb92F7Vn+Oqprxzn5Sr KJaENC8J1cEs57e0BT/ozOxW+j0iQRpfD/aCJv1RRvwAK2fJ//ADeDJgNwWA== 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= fm2; t=1704877302; x=1704963702; bh=Y6HLE5aSm9NwAcCLWMhOaAx/cwlx ZcrNkxEkJu+qppg=; b=SDheBZETHH1AUIHhFo1NVGQNoahPTWQlTb8iUJ6eZkKn 2rvqFa1MmvkrEEX3w279yeStQGHtj2rKoqxs1gL82LgpbMuNPfbMkUTw0LUSVSac LibBFF6MfixvX0TnjhVUpF3SY56y6dzptxVLxZB3nAbp1STjhser/0atcKcdsZYv 6sSLI8+fGeXpV/mCNqketmfU/luJiUyI5aq2qjpMFnKcJo7Uo0T9wzRP4jbPJU+W /t1FllEAKpc0xMx+HU1DrGV5aSRMy4p30tHIfTQ4/1FW/BpzNydgSq8ds8AJgR0E RHsJiCNSTrMoMHcr0MaG1cRkawEklu9scn0D4ysUwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeitddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrght rhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtth gvrhhnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleff teenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpsh esphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jan 2024 04:01:41 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id e7b444cb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 10 Jan 2024 08:59:00 +0000 (UTC) Date: Wed, 10 Jan 2024 10:01:39 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v2 1/6] t1300: make tests more robust with non-default ref backends Message-ID: <0552123fa30243d6d8d6b378991651dd6ade7de3.1704877233.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 we overwrite ".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 we also overwrite the repository format version as well as any potential extensions. With the upcoming "reftable" ref backend the result is that we may try to access refs via the "files" backend even though the repository has been initialized with the "reftable" backend. 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. Signed-off-by: Patrick Steinhardt --- t/t1300-config.sh | 74 ++++++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index f4e2752134..53c3d65823 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -1099,13 +1099,18 @@ test_expect_success SYMLINKS 'symlink to nonexistent configuration' ' ' 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_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' ' @@ -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 10 09:01:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13515790 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 31E043B1A4 for ; Wed, 10 Jan 2024 09:01:47 +0000 (UTC) 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="SAqKzYW5"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="94ECpkq3" Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 35F833200B51; Wed, 10 Jan 2024 04:01:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 10 Jan 2024 04:01:46 -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=fm2; t=1704877305; x=1704963705; bh=phw41TJKeE FGfh1MoHP9GCVLn/dPS6G6gZWpkt9ypYM=; b=SAqKzYW5vYmZSB2VyQZ2rPz0Cb tvEnVE5TzKGfanhmewmjQPfMwZ618lmXpCVRn9LoBD5vSQeB7pDKm+10+vEeU17V Z51u6VpK6wJd9b1UASYiJ9uTBEWKRjbP1bHElrQ14D4DhK390k/kyQDms4USDwK1 T3KTwfLpprztqsO0W/YQAaeCvZ+3CEBuifBID6JOI+PbvJFIbOBn7vfjTkQlkaJq Z/1FsOHpPZdoLs0AIyLQ0AMwN8nZJQ73DUu8DWxH1Y3YiRFa+T6k9aQwYtpuHDke fPiVZ0Q93DTkSxXGbG/RL0AoW1/vNc3BayaQpQMJNUqWFx2RkEAKaMVvG2RQ== 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= fm2; t=1704877305; x=1704963705; bh=phw41TJKeEFGfh1MoHP9GCVLn/dP S6G6gZWpkt9ypYM=; b=94ECpkq3dG7Dkrr8SVsLiCnqTSMb8wyAKlEsrdk/zsiH QGhOV6EAZJwuVQxhRsuHKFYTDfNcSvElcXALhqHIz9vliaknV1UeF0EEEhDf667I g2+YZ9dpTkKc0kINjrV5hdWmMlssfsEQbuovpQmAuK6OqLPt3xOxkap4yxDRfwfs VZ2fybHYgoF+leWOiqyCmZoEu/gGLQVJhN1AolPwa5SE1sRmoAQhGp8vj+wzI/r/ MF7FFZwUhVmvYB7gBCZ22wE+0gDlSG98DNNbZAZwLwxft6PWDuztOMG8kwV2PGf0 3UPV2Uiql6xUYI1SAO0fTG1gSDHhD1ur5iNVhix+3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeitddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrght rhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtth gvrhhnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleff teenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpsh esphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jan 2024 04:01:44 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id fe6f6c06 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 10 Jan 2024 08:59:05 +0000 (UTC) Date: Wed, 10 Jan 2024 10:01:43 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v2 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Message-ID: <384250fec217a806cc0f9930034f04ba2ee29201.1704877233.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 Wed Jan 10 09:01:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13515791 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 6B70A3C466 for ; Wed, 10 Jan 2024 09:01:51 +0000 (UTC) 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="qbmjOmni"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ruHdm2MB" Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5E2423200B44; Wed, 10 Jan 2024 04:01:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 10 Jan 2024 04:01:50 -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=fm2; t=1704877309; x=1704963709; bh=3pIX0sII2d L5B4G4hgysLOstEMigwsAfdygqpzpIMac=; b=qbmjOmni3zphENU0/adLVW6KCe dRY5H5eNtj4G1PNu93s/7G35unha+k9hhFId5+GW1Esw3EPNNF7xu7k6YeAokOKD BFziATWxq7bI/L/P0qNwnK5xcBheOpl9NZ7B82HGZ5WBskRJe++AV8P8Dv7hnp9r qb45eTPzgRdkJUQ/47rwt7/oJG9VxtIkQKaDZpk9727w9DL+tTmTbO1Dsc+WIYBc 2rz6lZDFsdC35DF3aYMhUHdKC77qcelA5ob4Izf5PQfVrp3SFZKobfjSQXTV0XcE 8HBp/1r/CJAswrgDhn8X5A6IHMQgNfl0qMfi0K5EI6EinvFiWuWAJC26iOdA== 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= fm2; t=1704877309; x=1704963709; bh=3pIX0sII2dL5B4G4hgysLOstEMig wsAfdygqpzpIMac=; b=ruHdm2MBRCMbSQzmNeVZ5Kzi0oMwnQfN2u4Qbj/OEt2D u6u5jZbTgbLLydxBbXtjmLMf9wpjB955aCdGGFSGoP6jWypZ9Ay2RN4sn1rzUVPJ 3H/xbHzVnHksDQJBEiGPVqh/lGAKDu3aM7RM3phs66uZU1pKIIgD7qKgAPM8KG12 3GfignRTwKWJmjS3xHivv05+WL2CW4PdMyeZrnXICu8oDtyBaWz7yzUJl2wL0zKT 267zcF+KUoOHczAJ4vjRPxygWak500PYxJBhSpjKsqu+pz46CKA8s7rH+4ozm0dj oPb8re8DFmuKjcfu5Ii1tEuCt7nG3keUBuiJWjJthg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeitddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrght rhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtth gvrhhnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleff teenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehpsh esphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jan 2024 04:01:48 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8d20aad1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 10 Jan 2024 08:59:09 +0000 (UTC) Date: Wed, 10 Jan 2024 10:01:47 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v2 3/6] t1302: make tests more robust with new extensions Message-ID: <1284b70fab6dd85114cb24fc5c7b6c49e35eb135.1704877233.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 t1302 we exercise logic around "core.repositoryFormatVersion" and extensions. These tests are not particularly robust against extensions like the newly introduced "refStorage" extension. 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. - 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. - Do not rewrite ".git/config" when exercising the "preciousObjects" extension. Signed-off-by: Patrick Steinhardt --- t/t1302-repo-version.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh index 179474fa65..7c680c91c4 100755 --- a/t/t1302-repo-version.sh +++ b/t/t1302-repo-version.sh @@ -28,7 +28,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 +84,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 +104,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 10 09:01:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13515792 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 A65AD3C466 for ; Wed, 10 Jan 2024 09:01:55 +0000 (UTC) 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="U9szqsY7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="7fImizCg" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8F1543200A02; Wed, 10 Jan 2024 04:01:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 10 Jan 2024 04:01:54 -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=fm2; t=1704877314; x=1704963714; bh=AHUBPTRIdk 2XQ23ZlFiS9PVLuF8+pbs7IAZIcTdf0Do=; b=U9szqsY7OkGz5B7rlsHHTekfYW ylVCAhh5M3v2F2neVNi+khAUfH9CScVZkHQGxl2wyU8xfAReX0v3PX/5ev1xiTUV 4M3aD1jvNYGkO5VqJHe3kANIolAroEA8Sl1bFy62Lkvps1BNm06aMUI4B2FoCok4 O+yiP2qVMTdcUHWQC2rENwvDES6NkGFfj79Hn0oJ5vxCU6rMA66uCoETjY/CtO9Y InXO92ySK7tUZiwXjJBc+rflbe/rqyoq2TcrbfMloxUy6nKhwya0ra+MupGIDli+ iGBtI7MowfGVQ+DMVcwUU1jpK9DpGGd+Q2TVL4cRWlzc0POk2Lfhin/V+PoA== 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= fm2; t=1704877314; x=1704963714; bh=AHUBPTRIdk2XQ23ZlFiS9PVLuF8+ pbs7IAZIcTdf0Do=; b=7fImizCgt6J2i3p8AAbZpphcWHLYjJGSp2GMF3asGhdd 2bKLveQkZRXFCQ64wLnr7/OLonaHO0IgW1FIVUkLrO1yeGG0EXq8nTGarGJzMSiU 5F4ZpKJEaeB4MTEVpGn/tl3ltOC0xdcAyCgSAN7YtnuGQIDQg65SzxGosa6PZ68b Cj9X2vtp4g660zpp5JAqpraaJtQnkfQMxCAzDL0tyxn58QNPm87eqP/GRUkf7ebB EAtT6r/NFPSAT1+RdliX1lBCj00AVJBbIWGPHqOHb5TlAXUyo991UqvwyS/RJRHT 8FsuvoZU/HF0FgiXPkfJ1OTRr35OYRoppzpX6sgBwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeitddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrght rhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtth gvrhhnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleff teenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehpsh esphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jan 2024 04:01:53 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id ac0f7ef1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 10 Jan 2024 08:59:13 +0000 (UTC) Date: Wed, 10 Jan 2024 10:01:51 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v2 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 10 09:01:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13515793 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 DF95B3D3AC for ; Wed, 10 Jan 2024 09:01:59 +0000 (UTC) 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="GKHFAHks"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="T3dbJOcA" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id A1CE13200B42; Wed, 10 Jan 2024 04:01:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 10 Jan 2024 04:01:59 -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=fm2; t=1704877318; x=1704963718; bh=bdrLr5rn+L AiMM3toT2I+4GvvVDnK4O14dnvBBWAxfo=; b=GKHFAHksglmMAg64WqdZy1KJww RrJpkh/pmliXYO4hB18FqhEXqrH3mP3vHfJqgVW510lYm6SM4gkvZe2X3c9DOGus LKn/nFxaflOH7KP1g4YIDXtHNB7m1rbW8n17TOESqRGkWP+7G8RxeM7J9hQ0MIlG A6OmBEng7voSyv70jlsyc6oCX5ZAyGiz+EeuAh6f/1uCl9DzUcjCaFi6+2Oe6KYd dxWtCiD6J+o9SdXIfzF25RsPfk1hZN9c0xEKmm5TeXnP6R/g5ZpxRfGCKmUD1QsS nlAVmVQH9aVKGB7PB09KHQUJXyXukHCTuJTRYUuiO7GxiO0Bo47KMV89s1ew== 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= fm2; t=1704877318; x=1704963718; bh=bdrLr5rn+LAiMM3toT2I+4GvvVDn K4O14dnvBBWAxfo=; b=T3dbJOcAPuhnLoVpfiR4s3CTt2izXChGy+FCeyyV+C5f M94Xd+mru4VzIMoAYZd3dKdrFq/GAKEbcfRauSbMUVNMenriwL20uVLOf/ICKZrK En3qTO5Bm2I2lMcSuESnNubCl9Rbv6g5A/HRBAPKGXqIjaI6bz6PtuOErT6sbxDR +ShgPLnNi2v36amQD2CQIM28uISIfFglzJw64vxOQvE/1c94tjk4F8RiVCgKFXyc cDtNp6iv7R59+dwBm81yEOJ2IkIjrEBCYcUOekxqRv9/LHZb+sjmmLWP33ahuAXs o2EM7YLt/jYKdRu0BqLLA1EAKmHkAHtfeiFwbR957w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeitddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrght rhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtth gvrhhnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleff teenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpsh esphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jan 2024 04:01:57 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id c3bdc065 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 10 Jan 2024 08:59:17 +0000 (UTC) Date: Wed, 10 Jan 2024 10:01:55 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v2 5/6] t5526: break test submodule differently 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 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 10 09:01:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13515794 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.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 285833E49C for ; Wed, 10 Jan 2024 09:02:03 +0000 (UTC) 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="qZVgDO4f"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EbHxi4o0" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 0DCEB3200B4F; Wed, 10 Jan 2024 04:02:02 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 10 Jan 2024 04:02:03 -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=fm2; t=1704877322; x=1704963722; bh=pX0vmVJoFU 1KAX0JhNsdfIwq38pXPRueRRT8g1z9Jiw=; b=qZVgDO4fihKhLZY2MKKUYjPWF1 EYSqYEFFt+v58bPsLlbuNJhKv3I/ucDlTmgYMgmRAIffl/5Mug66JPixNxOpulVa BXK1WNigL2t6jM7y3TnBiPES7ep/Bnu0hmpMn6rZw9m+1FWu8eV3LDT4NNGWrV2c 32WyRoA/yvRHHppfhCZKcnTkLAAVj4gdvSAOlltEZvR/Sastzx60I5VPhN9Y8NwK aprWmDsuAxrnJv9wBtJ7kEUAauvEmyuDwiZ2LB70L4vMTVSb/ZYUaI6SLPcTf4Vl hLfH4pk8b4gH1HHuN26FNgHNFA3QfiNw/17A7mC58KF6Y0F/NupkGgYvZ1lQ== 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= fm2; t=1704877322; x=1704963722; bh=pX0vmVJoFU1KAX0JhNsdfIwq38pX PRueRRT8g1z9Jiw=; b=EbHxi4o0EGGZwPwYMvHKT09yKlMbUNSCcj7rUWsS0vH9 ztcb0AyXFxzNyq8Stw6qT/8kCh6WLtC0uL4gAy94gdHNFmIGeP1NbnnhByTTSoFC XLg9gCrFxN0CcNRDwcfKHAj0ySJRu21XqFoqcTf1FaxR3fNkczK3Raq2joyWy67x 3uzKWNQQtl0QmDKJ10UmrGEcTNwXZbST0oyXUd6Y2BbisBOP/mmUr0lzrTXLI+jF 58dWwwfOcuNPBMt4ozlkc6m9TWZWA8qNRUvNk8GUCQ2yefIABSy1O7xCGy5I7Daq wBOzjxZSobi8tsfwK09D1Pkc7T8E+b6UF4FKNgI1eA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeitddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrght rhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtth gvrhhnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleff teenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpsh esphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jan 2024 04:02:01 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 79edf649 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 10 Jan 2024 08:59:21 +0000 (UTC) Date: Wed, 10 Jan 2024 10:01:59 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v2 6/6] t: mark tests regarding git-pack-refs(1) to be 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: 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 '