From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B8FE220197 for ; Mon, 28 Nov 2022 05:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1669613562; bh=iMNjlDyFsR0IGxAK2Vbj1xlyVYCBbrWO+1Nm1SROil0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qu0pkPcYFUEEsaNPF1YluLo7v1pTnZyILJH2D4QJgixYXB2ALZQC4JpqBHRaAoONa dV10O4MQLirRPgLbi43uv8Wgw2vGBPqeV2jWruhN2t6sDCKYC2ZAWGRIzphuCuEqrn FykxAmx7mMNFGVWZldU9jilWgSCblfmKX703ggP4= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 48/95] clone: flesh out --objstore behavior and document Date: Mon, 28 Nov 2022 05:31:45 +0000 Message-Id: <20221128053232.291618-49-e@80x24.org> In-Reply-To: <20221128053232.291618-1-e@80x24.org> References: <20221128053232.291618-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can support absolute paths to avoid surprising behaviors, but relative paths are preferred since the goal is to be accessible over the "dumb" HTTP git transport (the dumb transport is uses less memory and CPU on the server). --- Documentation/public-inbox-clone.pod | 12 ++++++++++++ lib/PublicInbox/LeiMirror.pm | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/public-inbox-clone.pod b/Documentation/public-inbox-clone.pod index 1c31fbb3..cee9f76e 100644 --- a/Documentation/public-inbox-clone.pod +++ b/Documentation/public-inbox-clone.pod @@ -6,6 +6,8 @@ public-inbox-clone - "git clone --mirror" wrapper public-inbox-clone INBOX_URL [INBOX_DIR] +public-inbox-clone ROOT_URL [DESTINATION] + =head1 DESCRIPTION public-inbox-clone is a wrapper around C for @@ -82,6 +84,16 @@ Force a remote public-inbox version (must be C<1> or C<2>). This is auto-detected by default, and this option exists mainly for testing. +=item --objstore[=DIR] + +Enables space savings when the remote C +includes C entries as generated by grokmirror 2.x. + +If C is not an absolute path, it is relative to the +C directory. If only C<--objstore> is specified +without C, then C (C<$DESTINATION/objstore>) +is the implied value of C. + =item -n =item --dry-run diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 6efe23fa..2f96058a 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -882,7 +882,8 @@ sub do_mirror { # via wq_io_do or public-inbox-clone if (defined(my $os = $lei->{opt}->{objstore})) { $os = 'objstore' if $os eq ''; # --objstore w/o args - $self->{-objstore} = "$self->{dst}/$os"; + $os = "$self->{dst}/$os" if $os !~ m!\A/!; + $self->{-objstore} = $os; } local $LIVE; my $iv = $lei->{opt}->{'inbox-version'} //