From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 06FD41F619 for ; Sat, 10 Sep 2022 20:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662840625; bh=bSJzAlxtlFTJBzNxVOKSaks1wIQlrWHC6D2aVcuo9kc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nEGOMT3XrKLBkqzTj0twkk2DIetGW2XCWdQkJljrySnII30k9DS1Md0h1FxrC0v30 8q17G8cNBaf2etgM4iozVtwA4REcovybhwarNf3X6/CQjYE2pdc1qd/yEXxNMSPmqg 9E17EPnyR8yqmlevf4RSU3UURhxFhln49ql3vweo= From: Eric Wong 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 Message-Id: <20220910201024.9651-3-e@80x24.org> In-Reply-To: <20220910201024.9651-1-e@80x24.org> References: <20220910201024.9651-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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