]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
cindex: support --associate-aggressive shortcut
authorEric Wong <e@80x24.org>
Mon, 13 Nov 2023 13:15:51 +0000 (13:15 +0000)
committerEric Wong <e@80x24.org>
Mon, 13 Nov 2023 21:55:09 +0000 (21:55 +0000)
This is shorthand to enabling --associate with the most
aggressive (and time-consuming) options available, starting from
the Unix epoch and having an unlimited window to join on.

lib/PublicInbox/CodeSearchIdx.pm
script/public-inbox-cindex

index 54ddb68e6139ac68ab0af5ca5c5403f11c44c85a..4ed5ea64279f7ddcf7a00228d5f7c6ddddebe6b5 100644 (file)
@@ -1146,6 +1146,11 @@ sub cidx_run { # main entry point
        local $self->{ASSOC_PFX} = \@ASSOC_PFX;
        local $self->{PENDING} = {};
        local $self->{-pi_cfg};
+       if ($self->{-opt}->{'associate-aggressive'}) { # shortcut
+               $self->{-opt}->{'associate-date-range'} //= '19700101000000..';
+               $self->{-opt}->{'associate-window'} //= -1;
+               $self->{-opt}->{associate} //= 1;
+       }
        if (grep { $_ } @{$self->{-opt}}{qw(prune associate)}) {
                require File::Temp;
                $TMPDIR = File::Temp->newdir('cidx-all-git-XXXX', TMPDIR => 1);
index b8133806dea0100d027bcd0bc9bbd3b0bc399e06..feb4a7f4c36a047e49b72c675ad2e9d0396c82f3 100755 (executable)
@@ -27,6 +27,7 @@ EOF
 my $opt = { fsync => 1, scan => 1 }; # --no-scan is hidden
 GetOptions($opt, qw(quiet|q verbose|v+ reindex jobs|j=i fsync|sync! dangerous
                indexlevel|index-level|L=s associate associate-window=i
+               associate-aggressive
                associate-date-range=s associate-prefixes=s@
                batch_size|batch-size=s max_size|max-size=s
                include|I=s@ only=s@ all show-roots