{"thread":{"id":"61302","subject":"[PATCH v6 1/2] send-email: move newline characters out of a few translatable strings","startedAt":"2024-04-10T07:01:39Z","lastAt":"2024-04-28T03:03:50Z","messageCount":15,"participants":["Dragan Simic","Junio C Hamano","Eric Sunshine"],"isPatch":true,"patchVersion":6,"patchTotal":2},"messages":[{"id":"492686","messageId":"29ea3a9b07bf1aa17b5d6a1e41325379c494bcb2.1712732383.git.dsimic@manjaro.org","threadId":"61302","inReplyTo":"cover.1712732383.git.dsimic@manjaro.org","subject":"[PATCH v6 1/2] send-email: move newline characters out of a few translatable strings","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-10T07:01:29Z","receivedAt":"2024-04-10T07:01:39Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"Move the already existing newline characters out of a few translatable\nstrings, to help a bit with the translation efforts.\n\nSigned-off-by: Dragan Simic <dsimic@manjaro.org>\n---\n git-send-email.perl | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 821b2b3a135a..f0be4b4560f7 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1664,9 +1664,11 @@ sub send_message {\n \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), $subject).$smtp->message;\n \t}\n \tif ($quiet) {\n-\t\tprintf($dry_run ? __(\"Dry-Sent %s\\n\") : __(\"Sent %s\\n\"), $subject);\n+\t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n+\t\tprint \"\\n\";\n \t} else {\n-\t\tprint($dry_run ? __(\"Dry-OK. Log says:\\n\") : __(\"OK. Log says:\\n\"));\n+\t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n+\t\tprint \"\\n\";\n \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) {\n \t\t\tprint \"Server: $smtp_server\\n\";\n \t\t\tprint \"MAIL FROM:<$raw_from>\\n\";\n@@ -1686,10 +1688,11 @@ sub send_message {\n \t\tprint $header, \"\\n\";\n \t\tif ($smtp) {\n \t\t\tprint __(\"Result: \"), $smtp->code, ' ',\n-\t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s), \"\\n\";\n+\t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s);\n \t\t} else {\n-\t\t\tprint __(\"Result: OK\\n\");\n+\t\t\tprint __(\"Result: OK\");\n \t\t}\n+\t\tprint \"\\n\";\n \t}\n \n \treturn 1;\n"},{"id":"492687","messageId":"cover.1712732383.git.dsimic@manjaro.org","threadId":"61302","inReplyTo":null,"subject":"[PATCH v6 0/2] send-email: make produced outputs more readable","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-10T07:01:28Z","receivedAt":"2024-04-10T07:01:39Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":" * send-email: make produced outputs more readable by separating\n   the result statuses and prompts from the other messages\n\nThis series makes the outputs of \"git send-mail\" more readable, by\nadding vertical whitespace to make discerning the messages produced\nfor each patch easy.  More specifically, these patches ensure that\nsingle newlines exists before the displayed result statues and after\nthe displayed confirmation prompts.\n\nMaking the outputs of \"git send-mail\" more readable is quite important,\nbecause the Git users rather regularly complain about the workflows that\nrequire project patches to be sent to various mailing lists.  Making the\nproduced outputs more readable can only help there.\n\nChanges in v6:\n    - Squashed the 3/3 patch into 2/2, because the simplified logic\n      no longer requires separate treatment for the prompts\n    - Moved the emitting of additional newlines into the send_message()\n      function, and simplified the whole logic;  the key is to notice\n      that the separation of message blocks comes from the emitted SMTP\n      traces, except when using the \"--quiet\" option, so emitting the\n      additional newlines as part of the emitting of the SMTP traces\n      makes everything much more simple\n    - Ensured that the newline is emitted before the SMTP trace even\n      if \"sendemail.confirm\" is set to \"auto\" or \"never\"\n    - Ensured that the newline is emitted before the brief outputs\n      when using the \"--quit\" option, regardless of \"sendemail.confirm\"\n      being set to \"auto\", \"always\" or \"never\"\n    - Improved the naming of a variable, as suggested by Junio [2]\n    - Improved the patch descriptions, as suggested by Junio, [1][2]\n      and updated to match the new nature of the patches\n    - Updated the test t9001 to learn about the additional newlines\n\nChanges in v5:\n    - Split into a three-patch series, because changes introduced in\n      some versions of this patch made the original assumptions about\n      squashing the changes together no longer apply [3]\n    - Updated and extended the patch descriptions, to hopefully describe\n      the changes performed in each patch a bit better\n\nChanges in v4:\n    - Dropped the changes to the styling of the produced prompts, as\n      reasonably requested by Junio, [4] because it extended the scope\n      of the patch with no good reason, and may also create issues on\n      some platforms, whose Perl packages may actually not support the\n      \"->ornaments()\" feature of Term::ReadLine\n    - Updated the patch description and the \"what's cooking\" summary\n      to cover the changes\n\nChanges in v3:\n    - Removed a redundant comment, as suggested by Junio [5]\n    - Did the right thing and made the vertical separators emitted as\n      message separators, instead of having them emitted as message\n      terminators, as suggested by Junio [5]\n    - Additional vertical whitespace is now also emitted after the\n      prompt for sending emails, to \"de-bunch\" it from the subsequent\n      messages and make discerning the messages easier\n    - The above-mentioned prompt no longer uses underlined text, to make\n      it significantly easier on the eyes\n    - Fixed one indentation by spaces to use tabs and removed one stray\n      newline in the source code, as spotted\n    - Updated and extended the patch description to cover the changes\n    - Updated the \"what's cooking\" summary to cover the changes\n    - Cleaned up the older notes a bit\n\nChanges in v2:\n    - Improved the way additional newline separators are introduced to\n      the source code, as suggested by Junio, [6], to help a bit with\n      the translation efforts\n    - Improved the patch subject and description a bit, to provide some\n      additional information, as suggested by Junio [6]\n    - Added a Helped-by tag\n\nNotes for v1:\n    - This is a resubmission of the patch I submitted about a week and\n      a half ago; [7]  the patch subject in the original submission was\n      selected in a bit unfortunate way, which this submission corrects,\n      and also improves the patch description a bit\n    - There are no changes to the patch itself, vs. the original patch\n\nLink to v1: https://lore.kernel.org/git/62553db377c28458883b66bcdc0c58cc0f32d15b.1712250366.git.dsimic@manjaro.org/T/#u\nLink to v2: https://lore.kernel.org/git/0e087ed992def0746f3d437253248904c2126464.1712262791.git.dsimic@manjaro.org/T/#u\nLink to v3: https://lore.kernel.org/git/e3212c0a4ad331685c68c13afcdbced20982ab32.1712364420.git.dsimic@manjaro.org/T/#u\nLink to v4: https://lore.kernel.org/git/8a9f4927aab96f2f62e2467e59fb6150d7e931fc.1712367983.git.dsimic@manjaro.org/T/#u\nLink to v5: https://lore.kernel.org/git/cover.1712486910.git.dsimic@manjaro.org/T/#u\n\n[1] https://lore.kernel.org/git/xmqq7ch7a7gt.fsf@gitster.g/\n[2] https://lore.kernel.org/git/xmqq1q7fa6u7.fsf@gitster.g/\n[3] https://lore.kernel.org/git/713c28cfc9dff2d01159105ddd2fd0f5@manjaro.org/\n[4] https://lore.kernel.org/git/xmqq8r1rs39g.fsf@gitster.g/\n[5] https://lore.kernel.org/git/xmqqzfu8yc40.fsf@gitster.g/\n[6] https://lore.kernel.org/git/xmqqy19tylrm.fsf@gitster.g/\n[7] https://lore.kernel.org/git/6ee28707b9eb8bd8fdfc8756c351455c6bc3bb62.1711447365.git.dsimic@manjaro.org/\n\nDragan Simic (2):\n  send-email: move newline characters out of a few translatable strings\n  send-email: make it easy to discern the messages for each patch\n\n git-send-email.perl   | 19 ++++++++++++-------\n t/t9001-send-email.sh | 10 ++++++++++\n 2 files changed, 22 insertions(+), 7 deletions(-)\n\nRange-diff against v5:\n1:  d2d456edcb5b ! 1:  29ea3a9b07bf send-email: move newline character out of a translatable string\n    @@ Metadata\n     Author: Dragan Simic <dsimic@manjaro.org>\n     \n      ## Commit message ##\n    -    send-email: move newline character out of a translatable string\n    +    send-email: move newline characters out of a few translatable strings\n     \n    -    Move the already existing newline character out of a translatable string,\n    -    to help a bit with the translation efforts.\n    +    Move the already existing newline characters out of a few translatable\n    +    strings, to help a bit with the translation efforts.\n     \n         Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n     \n      ## git-send-email.perl ##\n    +@@ git-send-email.perl: sub send_message {\n    + \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), $subject).$smtp->message;\n    + \t}\n    + \tif ($quiet) {\n    +-\t\tprintf($dry_run ? __(\"Dry-Sent %s\\n\") : __(\"Sent %s\\n\"), $subject);\n    ++\t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n    ++\t\tprint \"\\n\";\n    + \t} else {\n    +-\t\tprint($dry_run ? __(\"Dry-OK. Log says:\\n\") : __(\"OK. Log says:\\n\"));\n    ++\t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n    ++\t\tprint \"\\n\";\n    + \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) {\n    + \t\t\tprint \"Server: $smtp_server\\n\";\n    + \t\t\tprint \"MAIL FROM:<$raw_from>\\n\";\n     @@ git-send-email.perl: sub send_message {\n      \t\tprint $header, \"\\n\";\n      \t\tif ($smtp) {\n2:  7f8738308901 ! 2:  c78b043b5a6c send-email: make it easy to discern the messages for each patch\n    @@ Metadata\n      ## Commit message ##\n         send-email: make it easy to discern the messages for each patch\n     \n    -    When sending multiple patches at once, without prompting the user to confirm\n    -    the sending of each patch separately, the displayed result statuses for each\n    -    patch become bunched together with the messages produced for the subsequent\n    -    patch.  This unnecessarily makes discerning each of the result statuses a bit\n    -    difficult, as visible in the sample output excerpt below:\n    +    When sending one or multiple patches at once, the displayed result statuses\n    +    for each patch and the \"Send this email [y/n/a/...]?\" confirmation prompts\n    +    become bunched together with the messages produced for the subsequent patch,\n    +    or with the produced SMTP trace, respectively.\n    +\n    +    This makes reading the outputs unnecessarily harder, as visible in a couple\n    +    of excerpts from a sample output below:\n     \n             ...\n             MIME-Version: 1.0\n             Content-Transfer-Encoding: 8bit\n     \n             Result: 250\n             OK. Log says:\n    +        Server: smtp.example.com\n    +        MAIL FROM:<test@example.com>\n             ...\n     \n    -    As visible in the excerpt above, bunching the \"Result: <status-code>\" lines\n    -    together with the messages produced for the subsequent patch makes the output\n    -    unreadable, which actually becomes worse as the number of patches sent at\n    -    once increases.  To make the produced outputs more readable, add vertical\n    -    whitespace (more precisely, a newline) between the displayed result statuses\n    -    and the subsequent messages, as visible in the sample output excerpt below,\n    -    produced after the addition of vertical whitespace:\n    +        ...\n    +        MIME-Version: 1.0\n    +        Content-Transfer-Encoding: 8bit\n    +\n    +        Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n    +        OK. Log says:\n    +        Server: smtp.example.com\n    +        MAIL FROM:<test@example.com>\n    +        ...\n    +\n    +    As visible in the excerpts above, bunching the \"Result: <status-code>\" lines\n    +    or the \"Send this email [y/n/a/...]?\" confirmation prompts together with the\n    +    other messages makes the outputs a bit unreadable, which actually becomes\n    +    worse as the number of patches sent at once increases.\n    +\n    +    To make the produced outputs more readable, ensure that vertical whitespace\n    +    (more precisely, single newlines) exist before the displayed result statuses\n    +    and after the confirmation prompts, as visible in the two updated excerpts\n    +    from a sample output below:\n     \n             ...\n             MIME-Version: 1.0\n             Content-Transfer-Encoding: 8bit\n     \n             Result: 250\n     \n             OK. Log says:\n    +        Server: smtp.example.com\n    +        MAIL FROM:<test@example.com>\n    +        ...\n    +\n             ...\n    +        MIME-Version: 1.0\n    +        Content-Transfer-Encoding: 8bit\n    +\n    +        Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n     \n    -    These changes don't emit additional vertical whitespace after the result\n    -    status produced for the last processed patch, i.e. the vertical whitespace\n    -    is treated as a separator between the groups of produced messages, not as\n    -    their terminator.  This follows the Git's general approach of not wasting\n    -    the vertical screen space whenever reasonably possible.\n    +        OK. Log says:\n    +        Server: smtp.example.com\n    +        MAIL FROM:<test@example.com>\n    +        ...\n     \n         While there, remove a couple of spotted stray newlines in the source code\n         and convert one indentation from spaces to tabs, for consistency.\n     \n    -    The associated test, t9001, requires no updates to cover these changes.\n    +    Update the associated test, t9001, by including additional newlines into\n    +    the expected outputs of separate tests affected by these changes.\n     \n         Helped-by: Junio C Hamano <gitster@pobox.com>\n         Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n     \n      ## git-send-email.perl ##\n    -@@ git-send-email.perl: sub format_2822_time {\n    - my $compose_filename;\n    - my $force = 0;\n    - my $dump_aliases = 0;\n    -+my $needs_separator = 0;\n    - \n    - # Variables to prevent short format-patch options from being captured\n    - # as abbreviated send-email options\n     @@ git-send-email.perl: sub smtp_host_string {\n      \n      # Returns 1 if authentication succeeded or was not necessary\n      # (smtp_user was not specified), and 0 otherwise.\n     -\n      sub smtp_auth_maybe {\n      \tif (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq \"none\")) {\n      \t\treturn 1;\n    +@@ git-send-email.perl: sub gen_header {\n    + sub send_message {\n    + \tmy ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();\n    + \tmy @recipients = @$recipients_ref;\n    ++\tmy $confirm_shown = 0;\n    + \n    + \tmy @sendmail_parameters = ('-i', @recipients);\n    + \tmy $raw_from = $sender;\n     @@ git-send-email.perl: sub send_message {\n    - \t\t\texit(0);\n      \t\t} elsif (/^a/i) {\n      \t\t\t$confirm = 'never';\n    -+\t\t\t$needs_separator = 1;\n      \t\t}\n    -+\t} else {\n    -+\t\t$needs_separator = 1;\n    ++\t\t$confirm_shown = 1;\n      \t}\n      \n      \tunshift (@sendmail_parameters, @smtp_server_options);\n     @@ git-send-email.perl: sub send_message {\n      \t\tprint $sm \"$header\\n$message\";\n      \t\tclose $sm or die $!;\n      \t} else {\n     -\n      \t\tif (!defined $smtp_server) {\n      \t\t\tdie __(\"The required SMTP server is not properly defined.\")\n      \t\t}\n    +@@ git-send-email.perl: sub send_message {\n    + \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), $subject).$smtp->message;\n    + \t}\n    + \tif ($quiet) {\n    ++\t\tprint \"\\n\" if ($confirm_shown);\n    + \t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n    + \t\tprint \"\\n\";\n    + \t} else {\n    ++\t\tprint \"\\n\";\n    + \t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n    + \t\tprint \"\\n\";\n    + \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) {\n     @@ git-send-email.perl: sub pre_process_file {\n      sub process_file {\n      \tmy ($t) = @_;\n      \n     -        pre_process_file($t, $quiet);\n     +\tpre_process_file($t, $quiet);\n    -+\tprint \"\\n\" if ($needs_separator);\n      \n      \tmy $message_was_sent = send_message();\n      \tif ($message_was_sent == -1) {\n    +\n    + ## t/t9001-send-email.sh ##\n    +@@ t/t9001-send-email.sh: cat >expected-show-all-headers <<\\EOF\n    + (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-sob <<\\EOF\n    + (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-sob <<\\EOF\n    + (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-cccmd <<\\EOF\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    + (body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: test_expect_success $PREREQ 'sendemail.cccmd' '\n    + test_expect_success $PREREQ 'setup expect' '\n    + cat >expected-suppress-all <<\\EOF\n    + 0001-Second.patch\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-body <<\\EOF\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    + (cc-cmd) Adding cc: cc-cmd@example.com from: './cccmd'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-body-cccmd <<\\EOF\n    + (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-sob <<\\EOF\n    + (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-bodycc <<\\EOF\n    + (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n    + (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n    + (body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n    +@@ t/t9001-send-email.sh: cat >expected-suppress-cc <<\\EOF\n    + 0001-Second.patch\n    + (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n    + (body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n    ++\n    + Dry-OK. Log says:\n    + Server: relay.example.com\n    + MAIL FROM:<from@example.com>\n3:  7b99e5c7c0b0 < -:  ------------ send-email: separate the confirmation prompts from the messages\n"},{"id":"492688","messageId":"c78b043b5a6cf0de712d36e6e000804bd6e1316d.1712732383.git.dsimic@manjaro.org","threadId":"61302","inReplyTo":"cover.1712732383.git.dsimic@manjaro.org","subject":"[PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-10T07:01:30Z","receivedAt":"2024-04-10T07:01:40Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"When sending one or multiple patches at once, the displayed result statuses\nfor each patch and the \"Send this email [y/n/a/...]?\" confirmation prompts\nbecome bunched together with the messages produced for the subsequent patch,\nor with the produced SMTP trace, respectively.\n\nThis makes reading the outputs unnecessarily harder, as visible in a couple\nof excerpts from a sample output below:\n\n    ...\n    MIME-Version: 1.0\n    Content-Transfer-Encoding: 8bit\n\n    Result: 250\n    OK. Log says:\n    Server: smtp.example.com\n    MAIL FROM:<test@example.com>\n    ...\n\n    ...\n    MIME-Version: 1.0\n    Content-Transfer-Encoding: 8bit\n\n    Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n    OK. Log says:\n    Server: smtp.example.com\n    MAIL FROM:<test@example.com>\n    ...\n\nAs visible in the excerpts above, bunching the \"Result: <status-code>\" lines\nor the \"Send this email [y/n/a/...]?\" confirmation prompts together with the\nother messages makes the outputs a bit unreadable, which actually becomes\nworse as the number of patches sent at once increases.\n\nTo make the produced outputs more readable, ensure that vertical whitespace\n(more precisely, single newlines) exist before the displayed result statuses\nand after the confirmation prompts, as visible in the two updated excerpts\nfrom a sample output below:\n\n    ...\n    MIME-Version: 1.0\n    Content-Transfer-Encoding: 8bit\n\n    Result: 250\n\n    OK. Log says:\n    Server: smtp.example.com\n    MAIL FROM:<test@example.com>\n    ...\n\n    ...\n    MIME-Version: 1.0\n    Content-Transfer-Encoding: 8bit\n\n    Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n\n    OK. Log says:\n    Server: smtp.example.com\n    MAIL FROM:<test@example.com>\n    ...\n\nWhile there, remove a couple of spotted stray newlines in the source code\nand convert one indentation from spaces to tabs, for consistency.\n\nUpdate the associated test, t9001, by including additional newlines into\nthe expected outputs of separate tests affected by these changes.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Dragan Simic <dsimic@manjaro.org>\n---\n git-send-email.perl   |  8 +++++---\n t/t9001-send-email.sh | 10 ++++++++++\n 2 files changed, 15 insertions(+), 3 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex f0be4b4560f7..1d6712a44e95 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1361,7 +1361,6 @@ sub smtp_host_string {\n \n # Returns 1 if authentication succeeded or was not necessary\n # (smtp_user was not specified), and 0 otherwise.\n-\n sub smtp_auth_maybe {\n \tif (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq \"none\")) {\n \t\treturn 1;\n@@ -1510,6 +1509,7 @@ sub gen_header {\n sub send_message {\n \tmy ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();\n \tmy @recipients = @$recipients_ref;\n+\tmy $confirm_shown = 0;\n \n \tmy @sendmail_parameters = ('-i', @recipients);\n \tmy $raw_from = $sender;\n@@ -1555,6 +1555,7 @@ sub send_message {\n \t\t} elsif (/^a/i) {\n \t\t\t$confirm = 'never';\n \t\t}\n+\t\t$confirm_shown = 1;\n \t}\n \n \tunshift (@sendmail_parameters, @smtp_server_options);\n@@ -1576,7 +1577,6 @@ sub send_message {\n \t\tprint $sm \"$header\\n$message\";\n \t\tclose $sm or die $!;\n \t} else {\n-\n \t\tif (!defined $smtp_server) {\n \t\t\tdie __(\"The required SMTP server is not properly defined.\")\n \t\t}\n@@ -1664,9 +1664,11 @@ sub send_message {\n \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), $subject).$smtp->message;\n \t}\n \tif ($quiet) {\n+\t\tprint \"\\n\" if ($confirm_shown);\n \t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n \t\tprint \"\\n\";\n \t} else {\n+\t\tprint \"\\n\";\n \t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n \t\tprint \"\\n\";\n \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) {\n@@ -1923,7 +1925,7 @@ sub pre_process_file {\n sub process_file {\n \tmy ($t) = @_;\n \n-        pre_process_file($t, $quiet);\n+\tpre_process_file($t, $quiet);\n \n \tmy $message_was_sent = send_message();\n \tif ($message_was_sent == -1) {\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 5a771000c9ca..a5cb198a5c5f 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -208,6 +208,7 @@ cat >expected-show-all-headers <<\\EOF\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -821,6 +822,7 @@ cat >expected-suppress-sob <<\\EOF\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -869,6 +871,7 @@ cat >expected-suppress-sob <<\\EOF\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -904,6 +907,7 @@ cat >expected-suppress-cccmd <<\\EOF\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n (body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -940,6 +944,7 @@ test_expect_success $PREREQ 'sendemail.cccmd' '\n test_expect_success $PREREQ 'setup expect' '\n cat >expected-suppress-all <<\\EOF\n 0001-Second.patch\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -968,6 +973,7 @@ cat >expected-suppress-body <<\\EOF\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n (cc-cmd) Adding cc: cc-cmd@example.com from: './cccmd'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -1003,6 +1009,7 @@ cat >expected-suppress-body-cccmd <<\\EOF\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -1036,6 +1043,7 @@ cat >expected-suppress-sob <<\\EOF\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -1071,6 +1079,7 @@ cat >expected-suppress-bodycc <<\\EOF\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n (mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n (body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n@@ -1105,6 +1114,7 @@ cat >expected-suppress-cc <<\\EOF\n 0001-Second.patch\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n+\n Dry-OK. Log says:\n Server: relay.example.com\n MAIL FROM:<from@example.com>\n"},{"id":"492722","messageId":"xmqqr0fdw61k.fsf@gitster.g","threadId":"61302","inReplyTo":"29ea3a9b07bf1aa17b5d6a1e41325379c494bcb2.1712732383.git.dsimic@manjaro.org","subject":"Re: [PATCH v6 1/2] send-email: move newline characters out of a few translatable strings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-10T16:12:23Z","receivedAt":"2024-04-10T16:12:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dragan Simic <dsimic@manjaro.org> writes:\n\n> Move the already existing newline characters out of a few translatable\n> strings, to help a bit with the translation efforts.\n>\n> Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n> ---\n>  git-send-email.perl | 11 +++++++----\n>  1 file changed, 7 insertions(+), 4 deletions(-)\n\nLooking good.  Thanks for spotting similar issues and fixing them at\nthe same time.\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 821b2b3a135a..f0be4b4560f7 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1664,9 +1664,11 @@ sub send_message {\n>  \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), $subject).$smtp->message;\n>  \t}\n>  \tif ($quiet) {\n> -\t\tprintf($dry_run ? __(\"Dry-Sent %s\\n\") : __(\"Sent %s\\n\"), $subject);\n> +\t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n> +\t\tprint \"\\n\";\n>  \t} else {\n> -\t\tprint($dry_run ? __(\"Dry-OK. Log says:\\n\") : __(\"OK. Log says:\\n\"));\n> +\t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n> +\t\tprint \"\\n\";\n>  \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) {\n>  \t\t\tprint \"Server: $smtp_server\\n\";\n>  \t\t\tprint \"MAIL FROM:<$raw_from>\\n\";\n> @@ -1686,10 +1688,11 @@ sub send_message {\n>  \t\tprint $header, \"\\n\";\n>  \t\tif ($smtp) {\n>  \t\t\tprint __(\"Result: \"), $smtp->code, ' ',\n> -\t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s), \"\\n\";\n> +\t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s);\n>  \t\t} else {\n> -\t\t\tprint __(\"Result: OK\\n\");\n> +\t\t\tprint __(\"Result: OK\");\n>  \t\t}\n> +\t\tprint \"\\n\";\n>  \t}\n>  \n>  \treturn 1;\n"},{"id":"492723","messageId":"xmqqh6g9w5bf.fsf@gitster.g","threadId":"61302","inReplyTo":"c78b043b5a6cf0de712d36e6e000804bd6e1316d.1712732383.git.dsimic@manjaro.org","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-10T16:28:04Z","receivedAt":"2024-04-10T16:28:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dragan Simic <dsimic@manjaro.org> writes:\n\n> When sending one or multiple patches at once, the displayed result statuses\n> for each patch and the \"Send this email [y/n/a/...]?\" confirmation prompts\n> become bunched together with the messages produced for the subsequent patch,\n> or with the produced SMTP trace, respectively.\n>\n> This makes reading the outputs unnecessarily harder, as visible in a couple\n> of excerpts from a sample output below:\n\nIt is unclear where the boundaries between the messages in the\nexample are, though.\n\n>     ...\n>     MIME-Version: 1.0\n>     Content-Transfer-Encoding: 8bit\n>\n>     Result: 250\n\nIs this where one message ends, and the next line \"OK. Log says:\" is\nthe beginning of the next message?\n\n>     OK. Log says:\n>     Server: smtp.example.com\n>     MAIL FROM:<test@example.com>\n>     ...\n>\n>     ...\n>     MIME-Version: 1.0\n>     Content-Transfer-Encoding: 8bit\n\nIs the above about a single (i.e. the second) message ...\n\n>     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n\n... and the user is asked about that message?\n\n>     OK. Log says:\n>     Server: smtp.example.com\n>     MAIL FROM:<test@example.com>\n>     ...\n\nAnd is this about a separate (i.e. the third) message?  Without\nmaking these clear, it is hard to agree or disagree with the claim\nthat the current presentation is hard to read.\n\n>     MIME-Version: 1.0\n>     Content-Transfer-Encoding: 8bit\n>\n>     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n>\n>     OK. Log says:\n>     Server: smtp.example.com\n>     MAIL FROM:<test@example.com>\n>     ...\n\nThis is obviously in the realm of subjective preference, but I find\nthat the prompt line is distinct enough among all other output that\nwe do not need an extra blank line to locate them.\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index f0be4b4560f7..1d6712a44e95 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1361,7 +1361,6 @@ sub smtp_host_string {\n>  \n>  # Returns 1 if authentication succeeded or was not necessary\n>  # (smtp_user was not specified), and 0 otherwise.\n> -\n>  sub smtp_auth_maybe {\n>  \tif (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq \"none\")) {\n>  \t\treturn 1;\n> @@ -1510,6 +1509,7 @@ sub gen_header {\n>  sub send_message {\n>  \tmy ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();\n>  \tmy @recipients = @$recipients_ref;\n> +\tmy $confirm_shown = 0;\n>  \n>  \tmy @sendmail_parameters = ('-i', @recipients);\n>  \tmy $raw_from = $sender;\n> @@ -1555,6 +1555,7 @@ sub send_message {\n>  \t\t} elsif (/^a/i) {\n>  \t\t\t$confirm = 'never';\n>  \t\t}\n> +\t\t$confirm_shown = 1;\n>  \t}\n>  \n>  \tunshift (@sendmail_parameters, @smtp_server_options);\n> @@ -1576,7 +1577,6 @@ sub send_message {\n>  \t\tprint $sm \"$header\\n$message\";\n>  \t\tclose $sm or die $!;\n>  \t} else {\n> -\n>  \t\tif (!defined $smtp_server) {\n>  \t\t\tdie __(\"The required SMTP server is not properly defined.\")\n>  \t\t}\n> @@ -1664,9 +1664,11 @@ sub send_message {\n>  \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), $subject).$smtp->message;\n>  \t}\n>  \tif ($quiet) {\n> +\t\tprint \"\\n\" if ($confirm_shown);\n>  \t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n>  \t\tprint \"\\n\";\n>  \t} else {\n> +\t\tprint \"\\n\";\n>  \t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n>  \t\tprint \"\\n\";\n>  \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) {\n> @@ -1923,7 +1925,7 @@ sub pre_process_file {\n>  sub process_file {\n>  \tmy ($t) = @_;\n>  \n> -        pre_process_file($t, $quiet);\n> +\tpre_process_file($t, $quiet);\n>  \n>  \tmy $message_was_sent = send_message();\n>  \tif ($message_was_sent == -1) {\n\nI'll let others comment as the \"blank around prompt\" smells quite\nsubjective and do not want to be the sole reviewer on it.\n\nThanks, will queue.\n"},{"id":"492749","messageId":"CAPig+cQ+VV_Raxsk31vG8H4D5NjLsW5oFCA-o28raqrSRhi1TQ@mail.gmail.com","threadId":"61302","inReplyTo":"xmqqh6g9w5bf.fsf@gitster.g","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-04-10T22:59:01Z","receivedAt":"2024-04-10T22:59:13Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Apr 10, 2024 at 12:28 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Dragan Simic <dsimic@manjaro.org> writes:\n> >     MIME-Version: 1.0\n> >     Content-Transfer-Encoding: 8bit\n> >\n> >     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n> >\n> >     OK. Log says:\n> >     Server: smtp.example.com\n>\n> This is obviously in the realm of subjective preference, but I find\n> that the prompt line is distinct enough among all other output that\n> we do not need an extra blank line to locate them.\n>\n> I'll let others comment as the \"blank around prompt\" smells quite\n> subjective and do not want to be the sole reviewer on it.\n\nFor what it's worth, I had the same reaction about the extra blank\nline related to the prompt being unnecessary, but I didn't feel\nstrongly enough to say anything about it, and I still don't feel\nstrongly enough to suggest dropping this change.\n"},{"id":"492902","messageId":"fcf3331de77a623bceec6da6f3acbfed@manjaro.org","threadId":"61302","inReplyTo":"CAPig+cQ+VV_Raxsk31vG8H4D5NjLsW5oFCA-o28raqrSRhi1TQ@mail.gmail.com","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-13T06:10:33Z","receivedAt":"2024-04-13T06:10:36Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"Hello Eric,\n\nOn 2024-04-11 00:59, Eric Sunshine wrote:\n> On Wed, Apr 10, 2024 at 12:28 PM Junio C Hamano <gitster@pobox.com> \n> wrote:\n>> Dragan Simic <dsimic@manjaro.org> writes:\n>> >     MIME-Version: 1.0\n>> >     Content-Transfer-Encoding: 8bit\n>> >\n>> >     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n>> >\n>> >     OK. Log says:\n>> >     Server: smtp.example.com\n>> \n>> This is obviously in the realm of subjective preference, but I find\n>> that the prompt line is distinct enough among all other output that\n>> we do not need an extra blank line to locate them.\n>> \n>> I'll let others comment as the \"blank around prompt\" smells quite\n>> subjective and do not want to be the sole reviewer on it.\n> \n> For what it's worth, I had the same reaction about the extra blank\n> line related to the prompt being unnecessary, but I didn't feel\n> strongly enough to say anything about it, and I still don't feel\n> strongly enough to suggest dropping this change.\n\nBasically, I went with a rather simple reasoning:  the confirmation\nprompts, just like the SMTP statuses, aren't part of the emitted SMTP\ntraces and patch descriptions.  As such, separating the prompts with\nvertical whitespace is actually consistent, and should help with the\noverall readability, by taking the prompts visually out of the other\nproduced messages.\n"},{"id":"492903","messageId":"5e3e714dcbbcd0d44a035e34b922e01a@manjaro.org","threadId":"61302","inReplyTo":"xmqqr0fdw61k.fsf@gitster.g","subject":"Re: [PATCH v6 1/2] send-email: move newline characters out of a few translatable strings","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-13T06:12:38Z","receivedAt":"2024-04-13T06:12:41Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"Hello Junio,\n\nOn 2024-04-10 18:12, Junio C Hamano wrote:\n> Dragan Simic <dsimic@manjaro.org> writes:\n> \n>> Move the already existing newline characters out of a few translatable\n>> strings, to help a bit with the translation efforts.\n>> \n>> Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n>> ---\n>>  git-send-email.perl | 11 +++++++----\n>>  1 file changed, 7 insertions(+), 4 deletions(-)\n> \n> Looking good.  Thanks for spotting similar issues and fixing them at\n> the same time.\n\nI'm glad that you like it.\n\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index 821b2b3a135a..f0be4b4560f7 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1664,9 +1664,11 @@ sub send_message {\n>>  \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), \n>> $subject).$smtp->message;\n>>  \t}\n>>  \tif ($quiet) {\n>> -\t\tprintf($dry_run ? __(\"Dry-Sent %s\\n\") : __(\"Sent %s\\n\"), $subject);\n>> +\t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n>> +\t\tprint \"\\n\";\n>>  \t} else {\n>> -\t\tprint($dry_run ? __(\"Dry-OK. Log says:\\n\") : __(\"OK. Log \n>> says:\\n\"));\n>> +\t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n>> +\t\tprint \"\\n\";\n>>  \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) \n>> {\n>>  \t\t\tprint \"Server: $smtp_server\\n\";\n>>  \t\t\tprint \"MAIL FROM:<$raw_from>\\n\";\n>> @@ -1686,10 +1688,11 @@ sub send_message {\n>>  \t\tprint $header, \"\\n\";\n>>  \t\tif ($smtp) {\n>>  \t\t\tprint __(\"Result: \"), $smtp->code, ' ',\n>> -\t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s), \"\\n\";\n>> +\t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s);\n>>  \t\t} else {\n>> -\t\t\tprint __(\"Result: OK\\n\");\n>> +\t\t\tprint __(\"Result: OK\");\n>>  \t\t}\n>> +\t\tprint \"\\n\";\n>>  \t}\n>> \n>>  \treturn 1;\n"},{"id":"492904","messageId":"7dcc6f23cc7cb823cb19ec63c69c60e4@manjaro.org","threadId":"61302","inReplyTo":"xmqqh6g9w5bf.fsf@gitster.g","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-13T06:27:18Z","receivedAt":"2024-04-13T06:27:20Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-04-10 18:28, Junio C Hamano wrote:\n> Dragan Simic <dsimic@manjaro.org> writes:\n> \n>> When sending one or multiple patches at once, the displayed result \n>> statuses\n>> for each patch and the \"Send this email [y/n/a/...]?\" confirmation \n>> prompts\n>> become bunched together with the messages produced for the subsequent \n>> patch,\n>> or with the produced SMTP trace, respectively.\n>> \n>> This makes reading the outputs unnecessarily harder, as visible in a \n>> couple\n>> of excerpts from a sample output below:\n> \n> It is unclear where the boundaries between the messages in the\n> example are, though.\n> \n>>     ...\n>>     MIME-Version: 1.0\n>>     Content-Transfer-Encoding: 8bit\n>> \n>>     Result: 250\n> \n> Is this where one message ends, and the next line \"OK. Log says:\" is\n> the beginning of the next message?\n> \n>>     OK. Log says:\n>>     Server: smtp.example.com\n>>     MAIL FROM:<test@example.com>\n>>     ...\n>> \n>>     ...\n>>     MIME-Version: 1.0\n>>     Content-Transfer-Encoding: 8bit\n> \n> Is the above about a single (i.e. the second) message ...\n> \n>>     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n> \n> ... and the user is asked about that message?\n> \n>>     OK. Log says:\n>>     Server: smtp.example.com\n>>     MAIL FROM:<test@example.com>\n>>     ...\n\nHuh, I understand your confusion and those are all valid remarks.\nHowever, my intention was to include excerpts that are long enough\nto illustrate the points to someone already familiar enough with\nthe outputs produced by \"git send-mail\".\n\nIf that isn't good enough for the intended audience of the Git\nrepository log, I unfortunately see no good way to provide excerpts\nthat are long enough to eliminate any doubts.  Such excerpts would\nneed to be half a dozen screens long, which would turn the patch\ndescription into a monster.\n\nWith all that in mind, perhaps it's the best to simply delete all\nexcerpts from the patch description, if you agree?\n\n> And is this about a separate (i.e. the third) message?  Without\n> making these clear, it is hard to agree or disagree with the claim\n> that the current presentation is hard to read.\n> \n>>     MIME-Version: 1.0\n>>     Content-Transfer-Encoding: 8bit\n>> \n>>     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n>> \n>>     OK. Log says:\n>>     Server: smtp.example.com\n>>     MAIL FROM:<test@example.com>\n>>     ...\n> \n> This is obviously in the realm of subjective preference, but I find\n> that the prompt line is distinct enough among all other output that\n> we do not need an extra blank line to locate them.\n\nBasically, I went with a rather simple reasoning:  the confirmation\nprompts, just like the SMTP statuses, aren't part of the emitted SMTP\ntraces and patch descriptions.  They're different kinds of emitted\nmessages, if you agree.\n\nThus, separating the prompts with vertical whitespace is actually\nconsistent, and should help with the overall readability, by taking\nthe prompts visually out of the other produced messages.  In other\nwords, it's about keeping different kinds of emitted messages\nseparate, with the focus on the SMTP traces and patch descriptions,\ninstead of making the prompts locatable.\n\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index f0be4b4560f7..1d6712a44e95 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1361,7 +1361,6 @@ sub smtp_host_string {\n>> \n>>  # Returns 1 if authentication succeeded or was not necessary\n>>  # (smtp_user was not specified), and 0 otherwise.\n>> -\n>>  sub smtp_auth_maybe {\n>>  \tif (!defined $smtp_authuser || $auth || (defined $smtp_auth && \n>> $smtp_auth eq \"none\")) {\n>>  \t\treturn 1;\n>> @@ -1510,6 +1509,7 @@ sub gen_header {\n>>  sub send_message {\n>>  \tmy ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) \n>> = gen_header();\n>>  \tmy @recipients = @$recipients_ref;\n>> +\tmy $confirm_shown = 0;\n>> \n>>  \tmy @sendmail_parameters = ('-i', @recipients);\n>>  \tmy $raw_from = $sender;\n>> @@ -1555,6 +1555,7 @@ sub send_message {\n>>  \t\t} elsif (/^a/i) {\n>>  \t\t\t$confirm = 'never';\n>>  \t\t}\n>> +\t\t$confirm_shown = 1;\n>>  \t}\n>> \n>>  \tunshift (@sendmail_parameters, @smtp_server_options);\n>> @@ -1576,7 +1577,6 @@ sub send_message {\n>>  \t\tprint $sm \"$header\\n$message\";\n>>  \t\tclose $sm or die $!;\n>>  \t} else {\n>> -\n>>  \t\tif (!defined $smtp_server) {\n>>  \t\t\tdie __(\"The required SMTP server is not properly defined.\")\n>>  \t\t}\n>> @@ -1664,9 +1664,11 @@ sub send_message {\n>>  \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), \n>> $subject).$smtp->message;\n>>  \t}\n>>  \tif ($quiet) {\n>> +\t\tprint \"\\n\" if ($confirm_shown);\n>>  \t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n>>  \t\tprint \"\\n\";\n>>  \t} else {\n>> +\t\tprint \"\\n\";\n>>  \t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n>>  \t\tprint \"\\n\";\n>>  \t\tif (!defined $sendmail_cmd && !file_name_is_absolute($smtp_server)) \n>> {\n>> @@ -1923,7 +1925,7 @@ sub pre_process_file {\n>>  sub process_file {\n>>  \tmy ($t) = @_;\n>> \n>> -        pre_process_file($t, $quiet);\n>> +\tpre_process_file($t, $quiet);\n>> \n>>  \tmy $message_was_sent = send_message();\n>>  \tif ($message_was_sent == -1) {\n> \n> I'll let others comment as the \"blank around prompt\" smells quite\n> subjective and do not want to be the sole reviewer on it.\n> \n> Thanks, will queue.\n"},{"id":"493547","messageId":"0216a0e8369b8a3592dda90e5680be31@manjaro.org","threadId":"61302","inReplyTo":"7dcc6f23cc7cb823cb19ec63c69c60e4@manjaro.org","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-27T17:27:26Z","receivedAt":"2024-04-27T17:27:35Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"Hello Junio,\n\nJust checking, is there something I can do to get this patch\nseries moving forward?\n\nOn 2024-04-13 08:27, Dragan Simic wrote:\n> On 2024-04-10 18:28, Junio C Hamano wrote:\n>> Dragan Simic <dsimic@manjaro.org> writes:\n>> \n>>> When sending one or multiple patches at once, the displayed result \n>>> statuses\n>>> for each patch and the \"Send this email [y/n/a/...]?\" confirmation \n>>> prompts\n>>> become bunched together with the messages produced for the subsequent \n>>> patch,\n>>> or with the produced SMTP trace, respectively.\n>>> \n>>> This makes reading the outputs unnecessarily harder, as visible in a \n>>> couple\n>>> of excerpts from a sample output below:\n>> \n>> It is unclear where the boundaries between the messages in the\n>> example are, though.\n>> \n>>>     ...\n>>>     MIME-Version: 1.0\n>>>     Content-Transfer-Encoding: 8bit\n>>> \n>>>     Result: 250\n>> \n>> Is this where one message ends, and the next line \"OK. Log says:\" is\n>> the beginning of the next message?\n>> \n>>>     OK. Log says:\n>>>     Server: smtp.example.com\n>>>     MAIL FROM:<test@example.com>\n>>>     ...\n>>> \n>>>     ...\n>>>     MIME-Version: 1.0\n>>>     Content-Transfer-Encoding: 8bit\n>> \n>> Is the above about a single (i.e. the second) message ...\n>> \n>>>     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n>> \n>> ... and the user is asked about that message?\n>> \n>>>     OK. Log says:\n>>>     Server: smtp.example.com\n>>>     MAIL FROM:<test@example.com>\n>>>     ...\n> \n> Huh, I understand your confusion and those are all valid remarks.\n> However, my intention was to include excerpts that are long enough\n> to illustrate the points to someone already familiar enough with\n> the outputs produced by \"git send-mail\".\n> \n> If that isn't good enough for the intended audience of the Git\n> repository log, I unfortunately see no good way to provide excerpts\n> that are long enough to eliminate any doubts.  Such excerpts would\n> need to be half a dozen screens long, which would turn the patch\n> description into a monster.\n> \n> With all that in mind, perhaps it's the best to simply delete all\n> excerpts from the patch description, if you agree?\n> \n>> And is this about a separate (i.e. the third) message?  Without\n>> making these clear, it is hard to agree or disagree with the claim\n>> that the current presentation is hard to read.\n>> \n>>>     MIME-Version: 1.0\n>>>     Content-Transfer-Encoding: 8bit\n>>> \n>>>     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y\n>>> \n>>>     OK. Log says:\n>>>     Server: smtp.example.com\n>>>     MAIL FROM:<test@example.com>\n>>>     ...\n>> \n>> This is obviously in the realm of subjective preference, but I find\n>> that the prompt line is distinct enough among all other output that\n>> we do not need an extra blank line to locate them.\n> \n> Basically, I went with a rather simple reasoning:  the confirmation\n> prompts, just like the SMTP statuses, aren't part of the emitted SMTP\n> traces and patch descriptions.  They're different kinds of emitted\n> messages, if you agree.\n> \n> Thus, separating the prompts with vertical whitespace is actually\n> consistent, and should help with the overall readability, by taking\n> the prompts visually out of the other produced messages.  In other\n> words, it's about keeping different kinds of emitted messages\n> separate, with the focus on the SMTP traces and patch descriptions,\n> instead of making the prompts locatable.\n> \n>>> diff --git a/git-send-email.perl b/git-send-email.perl\n>>> index f0be4b4560f7..1d6712a44e95 100755\n>>> --- a/git-send-email.perl\n>>> +++ b/git-send-email.perl\n>>> @@ -1361,7 +1361,6 @@ sub smtp_host_string {\n>>> \n>>>  # Returns 1 if authentication succeeded or was not necessary\n>>>  # (smtp_user was not specified), and 0 otherwise.\n>>> -\n>>>  sub smtp_auth_maybe {\n>>>  \tif (!defined $smtp_authuser || $auth || (defined $smtp_auth && \n>>> $smtp_auth eq \"none\")) {\n>>>  \t\treturn 1;\n>>> @@ -1510,6 +1509,7 @@ sub gen_header {\n>>>  sub send_message {\n>>>  \tmy ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, \n>>> $header) = gen_header();\n>>>  \tmy @recipients = @$recipients_ref;\n>>> +\tmy $confirm_shown = 0;\n>>> \n>>>  \tmy @sendmail_parameters = ('-i', @recipients);\n>>>  \tmy $raw_from = $sender;\n>>> @@ -1555,6 +1555,7 @@ sub send_message {\n>>>  \t\t} elsif (/^a/i) {\n>>>  \t\t\t$confirm = 'never';\n>>>  \t\t}\n>>> +\t\t$confirm_shown = 1;\n>>>  \t}\n>>> \n>>>  \tunshift (@sendmail_parameters, @smtp_server_options);\n>>> @@ -1576,7 +1577,6 @@ sub send_message {\n>>>  \t\tprint $sm \"$header\\n$message\";\n>>>  \t\tclose $sm or die $!;\n>>>  \t} else {\n>>> -\n>>>  \t\tif (!defined $smtp_server) {\n>>>  \t\t\tdie __(\"The required SMTP server is not properly defined.\")\n>>>  \t\t}\n>>> @@ -1664,9 +1664,11 @@ sub send_message {\n>>>  \t\t$smtp->code =~ /250|200/ or die sprintf(__(\"Failed to send %s\\n\"), \n>>> $subject).$smtp->message;\n>>>  \t}\n>>>  \tif ($quiet) {\n>>> +\t\tprint \"\\n\" if ($confirm_shown);\n>>>  \t\tprintf($dry_run ? __(\"Dry-Sent %s\") : __(\"Sent %s\"), $subject);\n>>>  \t\tprint \"\\n\";\n>>>  \t} else {\n>>> +\t\tprint \"\\n\";\n>>>  \t\tprint($dry_run ? __(\"Dry-OK. Log says:\") : __(\"OK. Log says:\"));\n>>>  \t\tprint \"\\n\";\n>>>  \t\tif (!defined $sendmail_cmd && \n>>> !file_name_is_absolute($smtp_server)) {\n>>> @@ -1923,7 +1925,7 @@ sub pre_process_file {\n>>>  sub process_file {\n>>>  \tmy ($t) = @_;\n>>> \n>>> -        pre_process_file($t, $quiet);\n>>> +\tpre_process_file($t, $quiet);\n>>> \n>>>  \tmy $message_was_sent = send_message();\n>>>  \tif ($message_was_sent == -1) {\n>> \n>> I'll let others comment as the \"blank around prompt\" smells quite\n>> subjective and do not want to be the sole reviewer on it.\n>> \n>> Thanks, will queue.\n"},{"id":"493548","messageId":"xmqq8r0y66ub.fsf@gitster.g","threadId":"61302","inReplyTo":"0216a0e8369b8a3592dda90e5680be31@manjaro.org","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-27T17:41:48Z","receivedAt":"2024-04-27T17:42:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dragan Simic <dsimic@manjaro.org> writes:\n\n> Just checking, is there something I can do to get this patch\n> series moving forward?\n\nGet it into a shape that is more palatable to people?  That's easy\nto say and hard to define X-<.\n\nI didn't see anybody enthused about the change, and I didn't get\nenthused about it, either.\n"},{"id":"493549","messageId":"d4d63b9f3c7692bb48ac3e7ac34b663b@manjaro.org","threadId":"61302","inReplyTo":"xmqq8r0y66ub.fsf@gitster.g","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-27T17:49:03Z","receivedAt":"2024-04-27T17:49:05Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-04-27 19:41, Junio C Hamano wrote:\n> Dragan Simic <dsimic@manjaro.org> writes:\n> \n>> Just checking, is there something I can do to get this patch\n>> series moving forward?\n> \n> Get it into a shape that is more palatable to people?  That's easy\n> to say and hard to define X-<.\n> \n> I didn't see anybody enthused about the change, and I didn't get\n> enthused about it, either.\n\nHmm, I was under impression that the amount of discussion that\nalready went into the different versions of this series clearly\nshowed at least some interest in these patches.  We've reached\nthe sixth iteration, which shows something.\n"},{"id":"493550","messageId":"xmqqsez64r4d.fsf@gitster.g","threadId":"61302","inReplyTo":"d4d63b9f3c7692bb48ac3e7ac34b663b@manjaro.org","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-27T18:06:42Z","receivedAt":"2024-04-27T18:06:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dragan Simic <dsimic@manjaro.org> writes:\n\n> On 2024-04-27 19:41, Junio C Hamano wrote:\n>> Dragan Simic <dsimic@manjaro.org> writes:\n>> \n>>> Just checking, is there something I can do to get this patch\n>>> series moving forward?\n>> Get it into a shape that is more palatable to people?  That's easy\n>> to say and hard to define X-<.\n>> I didn't see anybody enthused about the change, and I didn't get\n>> enthused about it, either.\n>\n> Hmm, I was under impression that the amount of discussion that\n> already went into the different versions of this series clearly\n> showed at least some interest in these patches.  We've reached\n> the sixth iteration, which shows something.\n\nWell, v1 and v3-v5 saw comments only from me.  There was a comment\non v2 by Kristoffer Haugsbakk about phrasing in proposed log\nmessage.  v6 had Eric's \"Meh, either way\".\n\nI was not enthused in the topic myself, but was reviewing and\nsuggesting improvements merely to help you turn the patch into a\nshape that would interest others, but the thing is, if the current\noutput is good enough, it is perfectly normal that there is no more\nroom to make material improvements, and it is not your fault.\n\n\n[References]\n\nv1. https://lore.kernel.org/git/62553db377c28458883b66bcdc0c58cc0f32d15b.1712250366.git.dsimic@manjaro.org/\nv2. https://lore.kernel.org/git/0e087ed992def0746f3d437253248904c2126464.1712262791.git.dsimic@manjaro.org/\nv3. https://lore.kernel.org/git/e3212c0a4ad331685c68c13afcdbced20982ab32.1712364420.git.dsimic@manjaro.org/\nv4. https://lore.kernel.org/git/8a9f4927aab96f2f62e2467e59fb6150d7e931fc.1712367983.git.dsimic@manjaro.org/\nv5. https://lore.kernel.org/git/cover.1712486910.git.dsimic@manjaro.org/\nv6. https://lore.kernel.org/git/cover.1712732383.git.dsimic@manjaro.org/\n"},{"id":"493551","messageId":"xmqqo79u4qlc.fsf@gitster.g","threadId":"61302","inReplyTo":"xmqqsez64r4d.fsf@gitster.g","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-27T18:18:07Z","receivedAt":"2024-04-27T18:18:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Well, v1 and v3-v5 saw comments only from me.  There was a comment\n> on v2 by Kristoffer Haugsbakk about phrasing in proposed log\n> message.  v6 had Eric's \"Meh, either way\".\n\nFWIW, somewhere between v2 and v3 may have been a good place to\nstop.\n\n\"After calling send_message(), give an extra blank line before the\nnext message\" was extremely easy to see why it was a good idea.\nMixing it with \"oh, during the process of a single invocation of\nsend_message(), there may be other places that want extra blank\nlines\" made the changes less focused.  Personally I lost interest\nin the series at around that point.\n"},{"id":"493555","messageId":"499afd35a88df2c12327026f9f3ec468@manjaro.org","threadId":"61302","inReplyTo":"xmqqo79u4qlc.fsf@gitster.g","subject":"Re: [PATCH v6 2/2] send-email: make it easy to discern the messages for each patch","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-28T03:03:47Z","receivedAt":"2024-04-28T03:03:50Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-04-27 20:18, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n>> Well, v1 and v3-v5 saw comments only from me.  There was a comment\n>> on v2 by Kristoffer Haugsbakk about phrasing in proposed log\n>> message.  v6 had Eric's \"Meh, either way\".\n> \n> FWIW, somewhere between v2 and v3 may have been a good place to\n> stop.\n> \n> \"After calling send_message(), give an extra blank line before the\n> next message\" was extremely easy to see why it was a good idea.\n> Mixing it with \"oh, during the process of a single invocation of\n> send_message(), there may be other places that want extra blank\n> lines\" made the changes less focused.  Personally I lost interest\n> in the series at around that point.\n\nThank you for your additional feedback.\n\nAdmittedly, the whole endeavor could have been handled better from\nmy side, with fewer \"oh, let's do it differently and a bit better\"\niterations that inevitably made the whole thing harder to follow and\nbecome interested with.\n\nHowever, I find improving the way \"git send-mail\" works rather \nimportant,\nbecause if it bothers me, it must be bothering other people, who may\nsimply not be on the mailing list.  As we know, a lot of people quite\nregularly complain through different channels about sending patches by\nemail being not user-friendly, which should make any attempts to make\nit more user-friendly quite important, if you agree.\n\nI have some more plans for improving \"git send-mail\" and adding some new\nfeatures, but I need to get everything into the final shape I'm pretty\nmuch 100% satisfied with, both from the design and the implementation\nstandpoints, before sending the patches over.\n"}]}