dumping ground for random patches and texts
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH] v2writable: drop experimental DEBUG_DIFF support
Date: Fri,  7 Apr 2023 12:56:09 +0000	[thread overview]
Message-ID: <20230407125609.2259668-1-e@80x24.org> (raw)

I haven't used it in 5 years, and I doubt anybody else has,
either.  In any case, we have both `lei mail-diff' and diff
support in the WWW UI, now, so more convenient options are
available.
---
 lib/PublicInbox/V2Writable.pm | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 856442a9..ae8d778f 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # This interface wraps and mimics PublicInbox::Import
@@ -22,7 +22,6 @@ use PublicInbox::Spawn qw(spawn popen_rd run_die);
 use PublicInbox::Search;
 use PublicInbox::SearchIdx qw(log2stack is_ancestor check_size is_bad_blob);
 use IO::Handle; # ->autoflush
-use File::Temp ();
 use POSIX ();
 
 my $OID = qr/[a-f0-9]{40,}/;
@@ -660,23 +659,6 @@ sub import_init {
 	$im;
 }
 
-# XXX experimental
-sub diff ($$$) {
-	my ($mid, $cur, $new) = @_;
-
-	my $ah = File::Temp->new(TEMPLATE => 'email-cur-XXXX', TMPDIR => 1);
-	print $ah $cur->as_string or die "print: $!";
-	$ah->flush or die "flush: $!";
-	PublicInbox::Import::drop_unwanted_headers($new);
-	my $bh = File::Temp->new(TEMPLATE => 'email-new-XXXX', TMPDIR => 1);
-	print $bh $new->as_string or die "print: $!";
-	$bh->flush or die "flush: $!";
-	my $cmd = [ qw(diff -u), $ah->filename, $bh->filename ];
-	print STDERR "# MID conflict <$mid>\n";
-	my $pid = spawn($cmd, undef, { 1 => 2 });
-	waitpid($pid, 0) == $pid or die "diff did not finish";
-}
-
 sub get_blob ($$) {
 	my ($self, $smsg) = @_;
 	if (my $im = $self->{im}) {
@@ -700,9 +682,6 @@ sub content_exists ($$$) {
 		}
 		my $cur = PublicInbox::Eml->new($msg);
 		return 1 if content_matches($chashes, $cur);
-
-		# XXX DEBUG_DIFF is experimental and may be removed
-		diff($mid, $cur, $mime) if $ENV{DEBUG_DIFF};
 	}
 	undef;
 }

                 reply	other threads:[~2023-04-07 12:56 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=20230407125609.2259668-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).