From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH] codesearch: warn about pruned roots
Date: Sat, 23 Mar 2024 19:54:34 +0000 [thread overview]
Message-ID: <20240323195434.2317470-1-e@80x24.org> (raw)
---
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) {
reply other threads:[~2024-03-23 19:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240323195434.2317470-1-e@80x24.org \
--to=e@80x24.org \
--cc=spew@80x24.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).