git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH v2] send-email: make it easy to discern the messages for each patch
Date: Thu,  4 Apr 2024 22:34:28 +0200	[thread overview]
Message-ID: <0e087ed992def0746f3d437253248904c2126464.1712262791.git.dsimic@manjaro.org> (raw)

When sending multiple patches at once, without confirming the sending of each
patch separately, the displayed result statuses of sending each patch become
bunched together with the messages produced for the subsequent patch.  This
unnecessarily makes discerning each of the result statuses a bit difficult,
as visible in the sample output excerpt below:

    ...
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit

    Result: 250
    OK. Log says:
    ...

As visible above, bunching the "Result: <status-code>" lines together with
the messages produced for the subsequent patch makes the output unreadable.
Thus, let's add a newline after each displayed result status, to make the
outputs more readable, as visible in the sample output excerpt below:

    ...
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit

    Result: 250

    OK. Log says:
    ...

This change also adds a newline after the last produced result status, which
may be seen as redundant.  Though, it doesn't look too bad, and making that
last newline not displayed would make the code much more complex, which would
not be worth neither the time and effort now, nor the additional maintenance
burden in the future.

The way the additional newline separators are introduced to the source code
also moves the already existing newline characters out of the translatable
strings, which should help a bit with the translation efforts.

While there, remove one spotted stray newline in the source code.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---

Notes:
     * send-email: make produced outputs more readable by separating
       the result statuses from the subsequent patch outputs
    
    Changes in v2:
        - Improved the way additional newline separators are introduced to
          the source code, as suggested by Junio, [1], to help a bit with
          the translation efforts
        - Improved the patch subject and description a bit, to provide some
          additional information, as suggested by Junio [1]
    
    Notes for v1:
        - This is a resubmission of the patch I submitted about a week and
          a half ago. [2]  The patch subject in the original submission was
          selected in a bit unfortunate way, which this submission corrects,
          and also improves the patch description a bit.
        - There are no changes to the patch itself, vs. the original patch.
    
    Link to v1: https://lore.kernel.org/git/62553db377c28458883b66bcdc0c58cc0f32d15b.1712250366.git.dsimic@manjaro.org/T/#u
    
    [1] https://lore.kernel.org/git/xmqqy19tylrm.fsf@gitster.g/
    [2] https://lore.kernel.org/git/6ee28707b9eb8bd8fdfc8756c351455c6bc3bb62.1711447365.git.dsimic@manjaro.org/

 git-send-email.perl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 821b2b3a135a..ac0c691d3a46 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1576,7 +1576,6 @@ sub send_message {
 		print $sm "$header\n$message";
 		close $sm or die $!;
 	} else {
-
 		if (!defined $smtp_server) {
 			die __("The required SMTP server is not properly defined.")
 		}
@@ -1686,10 +1685,12 @@ sub send_message {
 		print $header, "\n";
 		if ($smtp) {
 			print __("Result: "), $smtp->code, ' ',
-				($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
+				($smtp->message =~ /\n([^\n]+\n)$/s);
 		} else {
-			print __("Result: OK\n");
+			print __("Result: OK");
 		}
+		# Make it easy to discern the messages for each patch
+		print "\n\n";
 	}
 
 	return 1;


             reply	other threads:[~2024-04-04 20:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 20:34 Dragan Simic [this message]
2024-04-04 22:52 ` [PATCH v2] send-email: make it easy to discern the messages for each patch Junio C Hamano
2024-04-04 23:44   ` Dragan Simic
2024-04-05 16:44     ` Junio C Hamano
2024-04-05 16:51       ` Dragan Simic
2024-04-05 17:13         ` Junio C Hamano
2024-04-05 17:18           ` Dragan Simic
2024-04-05  6:52 ` Kristoffer Haugsbakk
2024-04-05  7:07   ` Dragan Simic

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e087ed992def0746f3d437253248904c2126464.1712262791.git.dsimic@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).