From: Derrick Stolee Date: Thu, 13 Apr 2023 13:59:02 GMT Subject: Re: [PATCH v3 09/10] repack: honor `-l` when calculating pack geometry Message-ID: <52079b9b-a55c-e7d1-930e-38105dd8a85b@github.com> In-Reply-To: <285695deafa5a4a49f774dc484782dd8e4fd4997.1681384405.git.ps@pks.im> On 4/13/2023 7:16 AM, Patrick Steinhardt wrote: > When the user passes `-l` to git-repack(1), then they essentially ask us > to only repack objects part of the local object database while ignoring > any packfiles part of an alternate object database. And we in fact honor > this bit when doing a geometric repack as the resulting packfile will > only ever contain local objects. > + # Verify that our assumptions actually hold: both generated packfiles > + # should have three objects and should be non-equal. > + packed_objects shared/.git/objects/pack/pack-*.idx >packed-objects && > + test_line_count = 3 packed-objects && > + packed_objects member/.git/objects/pack/pack-*.idx >packed-objetcs && Typo: s/packed-objetcs/packed-objects/ > + test_line_count = 3 packed-objects && > + test "$(basename member/.git/objects/pack/pack-*.pack)" != "$(basename shared/.git/objects/pack/pack-*.pack)" && nit: could we do this where we store the output of the previous two commands into different files and then use "! test_cmp"? packed_objects shared/.git/objects/pack/pack-*.idx >shared-objects && packed_objects member/.git/objects/pack/pack-*.idx >member-objects && test_line_count = 3 shared-objects && test_line_count = 3 member-objects && ! test_cmp shared-objects member-objects && Thanks, -Stolee