user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 2/2] solver: do not show redundant URLs in log
  2022-09-10 20:10  6% [PATCH 0/2] www: solver linkification fixes Eric Wong
@ 2022-09-10 20:10  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-09-10 20:10 UTC (permalink / raw)
  To: meta

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

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/2] www: solver linkification fixes
@ 2022-09-10 20:10  6% Eric Wong
  2022-09-10 20:10  7% ` [PATCH 2/2] solver: do not show redundant URLs in log Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-09-10 20:10 UTC (permalink / raw)
  To: meta

Some things I noticed with /all/, solver, and redundant
messages.  Hunk header links for /all/ should point to
the right place, now; and the debug log output should
no longer have redundant URLs.

And deletions > insertions makes me happy :>

Eric Wong (2):
  view: fix solver links with multiple messages
  solver: do not show redundant URLs in log

 lib/PublicInbox/Feed.pm          |  1 +
 lib/PublicInbox/SolverGit.pm     |  5 +++--
 lib/PublicInbox/View.pm          | 20 ++------------------
 lib/PublicInbox/WwwAtomStream.pm |  1 +
 4 files changed, 7 insertions(+), 20 deletions(-)

^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-09-10 20:10  6% [PATCH 0/2] www: solver linkification fixes Eric Wong
2022-09-10 20:10  7% ` [PATCH 2/2] solver: do not show redundant URLs in log Eric Wong

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).