From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/2] solver: do not show redundant URLs in log
Date: Sat, 10 Sep 2022 20:10:24 +0000 [thread overview]
Message-ID: <20220910201024.9651-3-e@80x24.org> (raw)
In-Reply-To: <20220910201024.9651-1-e@80x24.org>
Messages in /all/ can get duplicated at times due to
list-appended signatures or buggy/malicious clients.
They'll all show up based on /$INBOX/$MSGID/,
so deduplicate the URLs to avoid noise.
---
lib/PublicInbox/SolverGit.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index ac655f34..b723b48a 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -554,8 +554,9 @@ sub extract_diffs_done {
my $diffs = delete $self->{tmp_diffs};
if (scalar @$diffs) {
unshift @{$self->{patches}}, @$diffs;
- dbg($self, "found $want->{oid_b} in " . join(" ||\n\t",
- map { di_url($self, $_) } @$diffs));
+ my %seen; # List::Util::uniq requires Perl 5.26+ :<
+ my @u = grep { !$seen{$_}++ } map { di_url($self, $_) } @$diffs;
+ dbg($self, "found $want->{oid_b} in " . join(" ||\n\t", @u));
++$self->{nr_p};
# good, we can find a path to the oid we $want, now
prev parent reply other threads:[~2022-09-10 20:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-10 20:10 [PATCH 0/2] www: solver linkification fixes Eric Wong
2022-09-10 20:10 ` [PATCH 1/2] view: fix solver links with multiple messages Eric Wong
2022-09-10 20:10 ` Eric Wong [this message]
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
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220910201024.9651-3-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).