]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: drop --subject from "git send-email" instructions
authorEric Wong <e@80x24.org>
Fri, 22 Jul 2022 20:18:09 +0000 (20:18 +0000)
committerEric Wong <e@80x24.org>
Thu, 28 Jul 2022 08:11:59 +0000 (08:11 +0000)
Apparently, --subject doesn't work[1] with "git send-email" in
this context.  So drop the CLI arg and add a note to tell the
user to set a "Subject:" line in their response body, instead.

[1] I'm not sure if --subject ever worked as I thought it would,
    or if it's a regression.  In either case, there are current
    versions of git where it doesn't, so just tell users to use
    the currently supported method.

Link: https://80x24.org/lore/git/CAC4O8c-Tf11CpwuRudyrpXv5bGshuyEenV9kKrs0zRWER-+yHA@mail.gmail.com/
lib/PublicInbox/Reply.pm
lib/PublicInbox/View.pm
t/reply.t

index 592dfb624f7a7091af7cdf4bd935d09624488d74..091f20bc00f35106afdef4a84df1d88372f61b22 100644 (file)
@@ -68,7 +68,6 @@ sub mailto_arg_link {
        my $obfs = $ibx->{obfuscate};
        my $subj = $hdr->header('Subject') || '';
        $subj = "Re: $subj" unless $subj =~ /\bRe:/i;
-       my $subj_raw = $subj;
        my $mid = $hdr->header_raw('Message-ID');
        push @arg, '--in-reply-to='.squote_maybe(mid_clean($mid));
        my $irt = mid_href($mid);
@@ -98,8 +97,6 @@ sub mailto_arg_link {
                }
        }
 
-       push @arg, "--subject=".squote_maybe($subj_raw);
-
        # I'm not sure if address obfuscation and mailto: links can
        # be made compatible; and address obfuscation is misguided,
        # anyways.
index b90cb08baadc04783c54a43853a39f5545dd983d..fa96cca337d87f9113425a209c5b78aafa2b6dfa 100644 (file)
@@ -142,6 +142,9 @@ $info
   <a
 href="$se_url">$se_url</a>
 $link</pre>
+
+  Be sure your reply has a <b>Subject:</b> header at the top and a blank line
+  before the message body.
 EOF
 }
 
index 41d72db22c6586eb771009c056b413123ddae77c..7319e2337dd18b95ab3c623b995ef25f8e037bd4 100644 (file)
--- a/t/reply.t
+++ b/t/reply.t
@@ -38,7 +38,6 @@ my $exp = [
     '--to=from@example.com',
     '--cc=cc@example.com',
     '--cc=to@example.com',
-    "--subject='Re: hihi'"
 ];
 
 is_deeply($arg, $exp, 'default reply is to :all');
@@ -46,8 +45,7 @@ $ibx->{replyto} = ':all';
 ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
 is_deeply($arg, $exp, '":all" also works');
 
-$exp = [ '--in-reply-to=blah@example.com', '--to=primary@example.com',
-       "--subject='Re: hihi'" ];
+$exp = [ '--in-reply-to=blah@example.com', '--to=primary@example.com' ];
 $ibx->{replyto} = ':list';
 ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
 is_deeply($arg, $exp, '":list" works for centralized lists');
@@ -57,7 +55,6 @@ $exp = [
         '--to=primary@example.com',
         '--cc=cc@example.com',
         '--cc=to@example.com',
-       "--subject='Re: hihi'"
 ];
 $ibx->{replyto} = ':list,Cc,To';
 ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
@@ -65,9 +62,7 @@ is_deeply($arg, $exp, '":list,Cc,To" works for kinda centralized lists');
 
 $ibx->{replyto} = 'new@example.com';
 ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
-$exp = [ '--in-reply-to=blah@example.com', '--to=new@example.com',
-       "--subject='Re: hihi'"
-];
+$exp = [ '--in-reply-to=blah@example.com', '--to=new@example.com' ];
 is_deeply($arg, $exp, 'explicit address works, too');
 
 $ibx->{replyto} = ':all';
@@ -78,7 +73,6 @@ $exp = [
     '--to=from@example$(echo .)com',
     '--cc=cc@example$(echo .)com',
     '--cc=to@example$(echo .)com',
-    "--subject='Re: hihi'"
 ];
 is_deeply($arg, $exp, 'address obfuscation works');
 is($link, '', 'no mailto: link given');