From 64f6a4c97b05a709de60aea9c3a5f51d7a37f226 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 2 Oct 2021 11:18:33 +0000 Subject: lei mail-diff: diagnostic command to diff mail contents This is useful in finding the cause of deduplication bugs, and possibly the cause of missing threads reported by Konstantin in <20211001130527.z7eivotlgqbgetzz@meerkat.local> usage: u=https://yhbt.net/lore/all/87czop5j33.fsf@tynnyri.adurom.net/raw lei mail-diff $u --- lib/PublicInbox/ContentHash.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/ContentHash.pm') diff --git a/lib/PublicInbox/ContentHash.pm b/lib/PublicInbox/ContentHash.pm index cc4a54c9..f6ae9011 100644 --- a/lib/PublicInbox/ContentHash.pm +++ b/lib/PublicInbox/ContentHash.pm @@ -52,9 +52,9 @@ sub content_dig_i { $dig->add($s); } -sub content_digest ($) { - my ($eml) = @_; - my $dig = Digest::SHA->new(256); +sub content_digest ($;$) { + my ($eml, $dig) = @_; + $dig //= Digest::SHA->new(256); # References: and In-Reply-To: get used interchangeably # in some "duplicates" in LKML. We treat them the same -- cgit v1.2.3-24-ge0c7