From c76a20d75200630b0b5072e4ce39651230f8cabe Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 28 Nov 2023 14:56:23 +0000 Subject: cindex: require `-g GIT_DIR' or `-r PROJECT_ROOT' Accepting @ARGV without switches ends up being ambiguous with optional parameters for --join and --show. Requiring users to specify `--join=' or `--show=' is a bit awkward (as it with -clone --objstore= and the like, but that is historical baggage we need to carry at this point...) --- lib/PublicInbox/CodeSearchIdx.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index a6cbe0b0..d49e9a8d 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -1131,8 +1131,6 @@ sub init_join_prefork ($) { } split(/,/, join(',', @$subopt)); require PublicInbox::CidxXapHelperAux; require PublicInbox::XapClient; - my $cfg = $self->{-opt}->{-pi_cfg} // die 'BUG: -pi_cfg unset'; - $self->{-cfg_f} = $cfg->{-f} = rel2abs_collapsed($cfg->{-f}); my @unknown; my $pfx = $JOIN{prefixes} // 'patchid'; for (split /\+/, $pfx) { @@ -1223,7 +1221,8 @@ sub cidx_run { # main entry point $PublicInbox::SearchIdx::BATCH_BYTES; local $MAX_SIZE = $self->{-opt}->{max_size}; local $self->{PENDING} = {}; # used by PublicInbox::CidxXapHelperAux - local $self->{-cfg_f}; + my $cfg = $self->{-opt}->{-pi_cfg} // die 'BUG: -pi_cfg unset'; + $self->{-cfg_f} = $cfg->{-f} = rel2abs_collapsed($cfg->{-f}); if (grep { $_ } @{$self->{-opt}}{qw(prune join)}) { require File::Temp; $TMPDIR = File::Temp->newdir('cidx-all-git-XXXX', TMPDIR => 1); -- cgit v1.2.3-24-ge0c7