From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (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 6626DB662 for ; Wed, 17 Jan 2024 07:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705476813; cv=none; b=fYBNT5DXbipn/kuLAhRw/KK8hDfha9FsK+lHaELdAFQ019dsUk0bcs8suJ9JUs6MwrFIXS3zCTb0UpQkF3EBz2e2ii7KSJcbJscbPkKC0Pe4huX46viDjExidfT/G0Oyy3w0iE3l+zdnWj8sdQKTF+9rZsINCEzcGaZysvhWSTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705476813; c=relaxed/simple; bh=XrEG18/76nuvMDdDZjg2jtvZkkQbZclqi1fEuCiAA+s=; h=Received:Received:DKIM-Signature:DKIM-Signature:X-ME-Sender: X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received: Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=AHu7zYz34Veg2Zys1J6gNwER1aogBdMBudPGp5G6+L+mw2YvQr1UHIjNAU8bGPxnegBRHT8BCYfCojJcposp/EyKdQpsq8zOr6UuSCtFMdohRNURvpVyu19Cr0hY+J4omgWWTgEX7NcrsEp50fT+YVhbOGMwGAGdjnMobkxnRYE= 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=sb5zDmxf; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=pze8eMJv; arc=none smtp.client-ip=64.147.123.24 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="sb5zDmxf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="pze8eMJv" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E4EC83200AD5; Wed, 17 Jan 2024 02:33:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 17 Jan 2024 02:33:30 -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=1705476809; x=1705563209; bh=46wfAyEiKg MzGWf9DhzLolResjgizElYhiLb4PpJWGk=; b=sb5zDmxfGbqx5MQymrth83CTOh OoHMHyVmef2GVe5vBDjqRFMhsVDZyShzoLtBTi0elEhVIXm4rUS6jjTNH63Wf0KX fD3Xhy1RvDsQFxMA1RaT7Fie8+9+5HQgCXn5mPbUlESjbMxQnfmKHBmSXah9tzep RSQVPcuETO/nQ0Ekc5i3VqzmdRIWh/ZfsP6R84vysvaVQDJ6s4qLYVQWphrPpDI0 CIigrCkfPhHEinIV1syow4yMNIi2dgfXfj6a11tAFZAnyoGys40lxMLVn/KvrMy9 lto4w3hBJjSibMT+G20IsnQGhEOWhQBSwuBwvatB9LvA2rgCWCw6j7g2lpvQ== 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=1705476809; x=1705563209; bh=46wfAyEiKgMzGWf9DhzLolResjgi zElYhiLb4PpJWGk=; b=pze8eMJvImb6j6fQfIM+AC0zB7jGU6bPZNs7XZ+BYCfg kKQwqhG2Xf7P21uZR1Eal55vycO5H0C+p7Diyogk6CVRzQSNR/G5tZBMQsp9G6DC IbhJ44XI5QnVcNSNFdVskAl50FdaFtUgkV6ODkUEnnVsvOsS9PV2tpxAgSTOhI6M BdFXRQXf1RHaI1brnoompj8C1tWbvN+G2kusEruUBHYjA4bYmcX3AWeAOXXXsVV4 2HpGDxzageL2nwgBnI5SWC9+UXBGaujUh4J8XkjT8Un5iP6gHCypGlQFbcS86tUx 4HMIN77aVpbz6aGEirm3Eg3/6rB0SrStZyaXVSvymQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdejgedguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuffkfhggtggujgesgh dtreertddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhs sehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepueektdevtdffveeljeetgfehheeige ekleduvdeffeeghefgledttdehjeelffetnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Jan 2024 02:33:28 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 793609a4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 17 Jan 2024 07:29:18 +0000 (UTC) Date: Wed, 17 Jan 2024 08:32:09 +0100 From: Patrick Steinhardt To: Taylor Blau Cc: git@vger.kernel.org, Jeff King , Junio C Hamano Subject: Re: [PATCH 1/2] t5332-multi-pack-reuse.sh: extract pack-objects helper functions Message-ID: References: <94dd41e1afdd6d926a106ab387295cf5fce624cf.1705431816.git.me@ttaylorr.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="igrthtNRuRCjX7DE" Content-Disposition: inline In-Reply-To: <94dd41e1afdd6d926a106ab387295cf5fce624cf.1705431816.git.me@ttaylorr.com> --igrthtNRuRCjX7DE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 16, 2024 at 02:03:44PM -0500, Taylor Blau wrote: > Most of the tests in t5332 perform some setup before repeating a common > refrain that looks like: >=20 > : >trace2.txt && > GIT_TRACE2_EVENT=3D"$PWD/trace2.txt" \ > git pack-objects --stdout --revs --all >/dev/null && >=20 > test_pack_reused $objects_nr test_packs_reused $packs_nr =20 > The next commit will add more tests which repeat the above refrain. > Avoid duplicating this invocation even further and prepare for the > following commit by wrapping the above in a helper function called > `test_pack_objects_reused_all()`. >=20 > Introduce another similar function `test_pack_objects_reused`, which > expects to read a list of revisions over stdin for tests which need more > fine-grained control of the contents of the pack they generate. >=20 > Signed-off-by: Taylor Blau > --- > t/t5332-multi-pack-reuse.sh | 70 +++++++++++++++---------------------- > 1 file changed, 28 insertions(+), 42 deletions(-) >=20 > diff --git a/t/t5332-multi-pack-reuse.sh b/t/t5332-multi-pack-reuse.sh > index 2ba788b042..b53e821bc0 100755 > --- a/t/t5332-multi-pack-reuse.sh > +++ b/t/t5332-multi-pack-reuse.sh > @@ -23,6 +23,26 @@ pack_position () { > grep "$1" objects | cut -d" " -f1 > } > =20 > +# test_pack_objects_reused_all > +test_pack_objects_reused_all () { > + : >trace2.txt && > + GIT_TRACE2_EVENT=3D"$PWD/trace2.txt" \ > + git pack-objects --stdout --revs --all >/dev/null && > + > + test_pack_reused "$1" + test_packs_reused "$2" +} > + > +# test_pack_objects_reused > +test_pack_objects_reused () { > + : >trace2.txt && > + GIT_TRACE2_EVENT=3D"$PWD/trace2.txt" \ > + git pack-objects --stdout --revs >/dev/null && > + > + test_pack_reused "$1" + test_packs_reused "$2" +} > + > test_expect_success 'preferred pack is reused for single-pack reuse' ' > test_config pack.allowPackReuse single && > =20 [snip] > @@ -104,12 +110,7 @@ test_expect_success 'reuse objects from first pack w= ith middle gap' ' > ^$(git rev-parse D) > EOF > =20 > - : >trace2.txt && > - GIT_TRACE2_EVENT=3D"$PWD/trace2.txt" \ > - git pack-objects --stdout --delta-base-offset --revs /dev/null && > - > - test_pack_reused 3 - test_packs_reused 1 + test_pack_objects_reused 3 1