]> Sergey Matveev's repositories - public-inbox.git/commitdiff
clone: flesh out --objstore behavior and document
authorEric Wong <e@80x24.org>
Mon, 28 Nov 2022 05:31:45 +0000 (05:31 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Nov 2022 23:38:56 +0000 (23:38 +0000)
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
lib/PublicInbox/LeiMirror.pm

index 1c31fbb3345000501ff2b814118d99e43e194f2e..cee9f76eec04cf39868a9d1a6719ed784ff5fc86 100644 (file)
@@ -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<git clone --mirror> 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<manifest.js.gz>
+includes C<forkgroup> entries as generated by grokmirror 2.x.
+
+If C<DIR> is not an absolute path, it is relative to the
+C<DESTINATION> directory.  If only C<--objstore> is specified
+without C<DIR>, then C<objstore> (C<$DESTINATION/objstore>)
+is the implied value of C<DIR>.
+
 =item -n
 
 =item --dry-run
index 6efe23fa9494c6a927ae4d5fe7edd9e61618bda2..2f96058a949c2d140ad1db595d047ede6aa5ec42 100644 (file)
@@ -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'} //