From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D62781FAED for ; Mon, 19 Mar 2018 08:15:01 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 10/27] import: (v2): write deletes to a separate '_' subdirectory Date: Mon, 19 Mar 2018 08:14:42 +0000 Message-Id: <20180319081459.10645-11-e@80x24.org> In-Reply-To: <20180319081459.10645-1-e@80x24.org> References: <20180319081459.10645-1-e@80x24.org> List-Id: In the future, we may store "purged" content IDs or other uncommon stuff under "_/" of the git tree. This keeps the top-level tree small and more amenable to deltafication. This helps the the common case where "m" is most commonly changed file at the top level. Also, use 'D' instead of 'd' since it matches git's '--raw' output format. --- lib/PublicInbox/Import.pm | 2 +- t/v2writable.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 94a49fe..6a640e2 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -208,7 +208,7 @@ sub remove { if (defined $path) { print $w "D $path\n\n" or wfail; } else { - print $w "M 100644 :$blob d\n\n" or wfail; + print $w "M 100644 :$blob _/D\n\n" or wfail; } $self->{nchg}++; (($self->{tip} = ":$commit"), $cur); diff --git a/t/v2writable.t b/t/v2writable.t index a5c982e..c6bcefd 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -210,7 +210,7 @@ EOF is(scalar(@found), 0, 'no longer found in Xapian skeleton'); my $after = $git0->qx(qw(log -1 --pretty=raw --raw -r --no-abbrev)); - if ($after =~ m!( [a-f0-9]+ )A\td$!) { + if ($after =~ m!( [a-f0-9]+ )A\t_/D$!) { my $oid = $1; ok(index($before, $oid) > 0, 'no new blob introduced'); } else { -- EW