* [PATCH] send-email: add newline for improved readability
@ 2024-03-26 10:04 Dragan Simic
2024-03-28 18:32 ` Dragan Simic
0 siblings, 1 reply; 2+ messages in thread
From: Dragan Simic @ 2024-03-26 10:04 UTC (permalink / raw)
To: git
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:
...
Let's add a newline after each displayed result status, to make reading the
produced outputs much easier, 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.
While there, remove one spotted stray newline in the code.
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---
git-send-email.perl | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 821b2b3a135a..62505ab2707c 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,9 +1685,9 @@ 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), "\n\n";
} else {
- print __("Result: OK\n");
+ print __("Result: OK\n\n");
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] send-email: add newline for improved readability
2024-03-26 10:04 [PATCH] send-email: add newline for improved readability Dragan Simic
@ 2024-03-28 18:32 ` Dragan Simic
0 siblings, 0 replies; 2+ messages in thread
From: Dragan Simic @ 2024-03-28 18:32 UTC (permalink / raw)
To: git
On 2024-03-26 11:04, Dragan Simic wrote:
> 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:
Just to clarify, this isn't about making code "neater", :) but about
making
the outputs more readable. Perhaps the patch subject could've been
selected
better, to be more descriptive.
>
> ...
> MIME-Version: 1.0
> Content-Transfer-Encoding: 8bit
>
> Result: 250
> OK. Log says:
> ...
>
> Let's add a newline after each displayed result status, to make reading
> the
> produced outputs much easier, 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.
>
> While there, remove one spotted stray newline in the code.
>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
> git-send-email.perl | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 821b2b3a135a..62505ab2707c 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,9 +1685,9 @@ 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), "\n\n";
> } else {
> - print __("Result: OK\n");
> + print __("Result: OK\n\n");
> }
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-28 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 10:04 [PATCH] send-email: add newline for improved readability Dragan Simic
2024-03-28 18:32 ` Dragan Simic
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.