* [PATCH] codesearch: warn about pruned roots
@ 2024-03-23 19:54 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-03-23 19:54 UTC (permalink / raw)
To: spew
---
lib/PublicInbox/CodeSearch.pm | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/PublicInbox/CodeSearch.pm b/lib/PublicInbox/CodeSearch.pm
index cceff3c6..950f25c2 100644
--- a/lib/PublicInbox/CodeSearch.pm
+++ b/lib/PublicInbox/CodeSearch.pm
@@ -222,10 +222,11 @@ sub _cmt_ct { # retry_reopen cb
my ($self, $cmt) = @_;
my @ids = sort { $a <=> $b } $self->docids_by_postlist('Q'.$cmt);
if (!@ids) {
- carp "W: commit $cmt not indexed";
- return (time + 3600);
+ carp
+"W: commit $cmt not indexed (--prune isn't exhaustive, yet)";
+ return;
}
- scalar(@ids) == 1 or carp "BUG? `$cmt' indexed multiple times\n";
+ scalar(@ids) == 1 or carp "BUG? commit $cmt indexed multiple times\n";
for my $id (@ids) {
my $doc = $self->get_doc($id) or next;
return int_val($doc, CT);
@@ -249,6 +250,7 @@ BUG? (non-fatal) `$git_dir' not indexed in $self->{topdir}
if (@ids > 1) {
@ret = uniqstr(@ret);
my %ct = map { $_ => commit_ct($self, $_) } @ret;
+ @ret = grep { defined($ct{$_}) } @ret;
@ret = sort { $ct{$a} <=> $ct{$b} } @ret ;
}
@ret;
@@ -264,7 +266,8 @@ sub paths2roots { # for diagnostics
my %ct;
for my $root_oidhex (keys %$tmp) {
my $paths = delete $tmp->{$root_oidhex};
- $ct{$root_oidhex} = commit_ct($self, $root_oidhex);
+ $ct{$root_oidhex} = commit_ct($self, $root_oidhex) //
+ next;
push @{$ret{$_}}, $root_oidhex for @$paths;
}
for my $oids (values %ret) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-23 19:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-23 19:54 [PATCH] codesearch: warn about pruned roots Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).