{"thread":{"id":"58184","subject":"git-send-email doesn't entirely understand --subject (or --in-reply-to)","startedAt":"2022-07-18T23:41:13Z","lastAt":"2022-07-22T20:26:05Z","messageCount":2,"participants":["Britton Kerin","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"459340","messageId":"CAC4O8c-Tf11CpwuRudyrpXv5bGshuyEenV9kKrs0zRWER-+yHA@mail.gmail.com","threadId":"58184","inReplyTo":null,"subject":"git-send-email doesn't entirely understand --subject (or --in-reply-to)","fromName":"Britton Kerin","fromEmail":"britton.kerin@gmail.com","sentAt":"2022-07-18T23:40:59Z","receivedAt":"2022-07-18T23:41:13Z","isPatch":false,"sender":{"key":"britton.kerin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/7434164?v=4"},"body":"I'm not absolutely sure this is git's fault but I tried to use the\nreply mechanism described here:\n\n     https://public-inbox.org/git/20220718232843.151392-1-britton.kerin@gmail.com/#R\n\nwhic is to say this:\n\n     git send-email \\\n         --in-reply-to=20220718232843.151392-1-britton.kerin@gmail.com \\\n         --to=britton.kerin@gmail.com \\\n         --cc=git@vger.kernel.org \\\n         --cc=gitster@pobox.com \\\n         --cc=newren@gmail.com \\\n         --subject='Re: BUG: git-check-ignore documentation doesn'\\''t\ncome close to describing what it really does' \\\n         /path/to/YOUR_REPLY\n\nand it failed like this:\n\n$ git send-email     --in-reply-to=xmqqtu7lc587.fsf@gitster.g\n--to=britton.kerin@gmail.com   --subject='Re: BUG: git-check-ignore\ndocumentation doesn'\\''t come close to describing what it really does'\n~/my_reply_git_checkignore_bug_post\n/home/bkerin/my_reply_git_checkignore_bug_post\nNo subject line in /home/bkerin/my_reply_git_checkignore_bug_post? at\n/usr/lib/git-core/git-send-email line 720.\n\nUntil I added this line to the top of\n/home/bkerin/my_reply_git_checkignore_bug_post:\n\n     Subject: Re: BUG: git-check-ignore documentation doesn't come\nclose to describing what it really does\n\nmaybe this is normal but it seems weird given the presence of\n--in-reply-to and --subject and the fact that I didn't need to copy\nany other headers in.\n\nBritton\n"},{"id":"459792","messageId":"20220722201809.GA21894@dcvr","threadId":"58184","inReplyTo":"CAC4O8c-Tf11CpwuRudyrpXv5bGshuyEenV9kKrs0zRWER-+yHA@mail.gmail.com","subject":"Re: git-send-email doesn't entirely understand --subject (or --in-reply-to)","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2022-07-22T20:18:09Z","receivedAt":"2022-07-22T20:26:05Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Britton Kerin <britton.kerin@gmail.com> wrote:\n> I'm not absolutely sure this is git's fault but I tried to use the\n> reply mechanism described here:\n> \n>      https://public-inbox.org/git/20220718232843.151392-1-britton.kerin@gmail.com/#R\n> \n> whic is to say this:\n> \n>      git send-email \\\n>          --in-reply-to=20220718232843.151392-1-britton.kerin@gmail.com \\\n>          --to=britton.kerin@gmail.com \\\n>          --cc=git@vger.kernel.org \\\n>          --cc=gitster@pobox.com \\\n>          --cc=newren@gmail.com \\\n>          --subject='Re: BUG: git-check-ignore documentation doesn'\\''t\n> come close to describing what it really does' \\\n>          /path/to/YOUR_REPLY\n> \n> and it failed like this:\n\n+cc meta@public-inbox.org since that's where the instructions come from.\n\n> $ git send-email     --in-reply-to=xmqqtu7lc587.fsf@gitster.g\n> --to=britton.kerin@gmail.com   --subject='Re: BUG: git-check-ignore\n> documentation doesn'\\''t come close to describing what it really does'\n> ~/my_reply_git_checkignore_bug_post\n> /home/bkerin/my_reply_git_checkignore_bug_post\n> No subject line in /home/bkerin/my_reply_git_checkignore_bug_post? at\n> /usr/lib/git-core/git-send-email line 720.\n> \n> Until I added this line to the top of\n> /home/bkerin/my_reply_git_checkignore_bug_post:\n> \n>      Subject: Re: BUG: git-check-ignore documentation doesn't come\n> close to describing what it really does\n> \n> maybe this is normal but it seems weird given the presence of\n> --in-reply-to and --subject and the fact that I didn't need to copy\n> any other headers in.\n\nI suppose making this change to https://80x24.org/public-inbox.git\nis in order:\n--------8<--------\nSubject: [PATCH] www: drop --subject from \"git send-email\" instructions\n\nApparently, --subject doesn't work[1] with \"git send-email\" in\nthis context.  So drop the CLI arg and add a note to tell the\nuser to set a \"Subject:\" line in their response body, instead.\n\n[1] I'm not sure if --subject ever worked as I thought it would,\n    or if it's a regression.  In either case, there are current\n    versions of git where it doesn't, so just tell users to use\n    the currently supported method.\n\nLink: https://80x24.org/lore/git/CAC4O8c-Tf11CpwuRudyrpXv5bGshuyEenV9kKrs0zRWER-+yHA@mail.gmail.com/\n---\n lib/PublicInbox/Reply.pm |  3 ---\n lib/PublicInbox/View.pm  |  3 +++\n t/reply.t                | 10 ++--------\n 3 files changed, 5 insertions(+), 11 deletions(-)\n\ndiff --git a/lib/PublicInbox/Reply.pm b/lib/PublicInbox/Reply.pm\nindex 592dfb62..091f20bc 100644\n--- a/lib/PublicInbox/Reply.pm\n+++ b/lib/PublicInbox/Reply.pm\n@@ -68,7 +68,6 @@ sub mailto_arg_link {\n \tmy $obfs = $ibx->{obfuscate};\n \tmy $subj = $hdr->header('Subject') || '';\n \t$subj = \"Re: $subj\" unless $subj =~ /\\bRe:/i;\n-\tmy $subj_raw = $subj;\n \tmy $mid = $hdr->header_raw('Message-ID');\n \tpush @arg, '--in-reply-to='.squote_maybe(mid_clean($mid));\n \tmy $irt = mid_href($mid);\n@@ -98,8 +97,6 @@ sub mailto_arg_link {\n \t\t}\n \t}\n \n-\tpush @arg, \"--subject=\".squote_maybe($subj_raw);\n-\n \t# I'm not sure if address obfuscation and mailto: links can\n \t# be made compatible; and address obfuscation is misguided,\n \t# anyways.\ndiff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm\nindex b90cb08b..fa96cca3 100644\n--- a/lib/PublicInbox/View.pm\n+++ b/lib/PublicInbox/View.pm\n@@ -142,6 +142,9 @@ $info\n   <a\n href=\"$se_url\">$se_url</a>\n $link</pre>\n+\n+  Be sure your reply has a <b>Subject:</b> header at the top and a blank line\n+  before the message body.\n EOF\n }\n \ndiff --git a/t/reply.t b/t/reply.t\nindex 41d72db2..7319e233 100644\n--- a/t/reply.t\n+++ b/t/reply.t\n@@ -38,7 +38,6 @@ my $exp = [\n     '--to=from@example.com',\n     '--cc=cc@example.com',\n     '--cc=to@example.com',\n-    \"--subject='Re: hihi'\"\n ];\n \n is_deeply($arg, $exp, 'default reply is to :all');\n@@ -46,8 +45,7 @@ $ibx->{replyto} = ':all';\n ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);\n is_deeply($arg, $exp, '\":all\" also works');\n \n-$exp = [ '--in-reply-to=blah@example.com', '--to=primary@example.com',\n-\t\"--subject='Re: hihi'\" ];\n+$exp = [ '--in-reply-to=blah@example.com', '--to=primary@example.com' ];\n $ibx->{replyto} = ':list';\n ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);\n is_deeply($arg, $exp, '\":list\" works for centralized lists');\n@@ -57,7 +55,6 @@ $exp = [\n \t '--to=primary@example.com',\n \t '--cc=cc@example.com',\n \t '--cc=to@example.com',\n-\t\"--subject='Re: hihi'\"\n ];\n $ibx->{replyto} = ':list,Cc,To';\n ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);\n@@ -65,9 +62,7 @@ is_deeply($arg, $exp, '\":list,Cc,To\" works for kinda centralized lists');\n \n $ibx->{replyto} = 'new@example.com';\n ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);\n-$exp = [ '--in-reply-to=blah@example.com', '--to=new@example.com',\n-\t\"--subject='Re: hihi'\"\n-];\n+$exp = [ '--in-reply-to=blah@example.com', '--to=new@example.com' ];\n is_deeply($arg, $exp, 'explicit address works, too');\n \n $ibx->{replyto} = ':all';\n@@ -78,7 +73,6 @@ $exp = [\n     '--to=from@example$(echo .)com',\n     '--cc=cc@example$(echo .)com',\n     '--cc=to@example$(echo .)com',\n-    \"--subject='Re: hihi'\"\n ];\n is_deeply($arg, $exp, 'address obfuscation works');\n is($link, '', 'no mailto: link given');\n\n"}]}