From 4eee5af6011cc8cdefb66c9729952c7eff5c0b0b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 22 Jul 2022 20:18:09 +0000 Subject: [PATCH] www: drop --subject from "git send-email" instructions 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 | 3 --- lib/PublicInbox/View.pm | 3 +++ t/reply.t | 10 ++-------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/PublicInbox/Reply.pm b/lib/PublicInbox/Reply.pm index 592dfb62..091f20bc 100644 --- a/lib/PublicInbox/Reply.pm +++ b/lib/PublicInbox/Reply.pm @@ -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. diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index b90cb08b..fa96cca3 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -142,6 +142,9 @@ $info $se_url $link + + Be sure your reply has a Subject: header at the top and a blank line + before the message body. EOF } diff --git a/t/reply.t b/t/reply.t index 41d72db2..7319e233 100644 --- 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'); -- 2.44.0