git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dragan Simic <dsimic@manjaro.org>
Cc: git@vger.kernel.org,  code@khaugsbakk.name
Subject: Re: [PATCH v5 3/3] send-email: separate the confirmation prompts from the messages
Date: Mon, 08 Apr 2024 14:21:36 -0700	[thread overview]
Message-ID: <xmqq1q7fa6u7.fsf@gitster.g> (raw)
In-Reply-To: <7b99e5c7c0b0c8d3d7eaaae169e650ebe81964a1.1712486910.git.dsimic@manjaro.org> (Dragan Simic's message of "Sun, 7 Apr 2024 12:48:52 +0200")

Dragan Simic <dsimic@manjaro.org> writes:

> Emit additional vertical whitespace after the "Send this email [y/n/...]?"
> confirmation prompts, more specifically after each confirmed email is sent,
> but before the subsequent messages are emitted, to make the produced output
> more readable.  The subsequent produced messages were bunched together with
> the confirmation prompts, as visible in the sample output excerpt below,
> which made discerning the outputs unnecessarily harder.
>
>     ...
>     Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y
>     OK. Log says:
>     ...

What comes before "send this email" prompt needs to be shown to make
the argument more convincing, but with "..." there is no cue to decide
if the output is hard to read.

>  sub send_message {
>  	my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();
>  	my @recipients = @$recipients_ref;
> +	my $prompt_separator = 0;
>  
>  	my @sendmail_parameters = ('-i', @recipients);
>  	my $raw_from = $sender;
> @@ -1556,6 +1557,7 @@ sub send_message {
>  			$confirm = 'never';
>  			$needs_separator = 1;
>  		}
> +		$prompt_separator = 1;
>  	} else {
>  		$needs_separator = 1;
>  	}
> @@ -1665,6 +1667,7 @@ sub send_message {
>  		$smtp->dataend() or die $smtp->message;
>  		$smtp->code =~ /250|200/ or die sprintf(__("Failed to send %s\n"), $subject).$smtp->message;
>  	}
> +	print "\n" if ($prompt_separator);

"prompt separator" sounds more like a separator that separates
prompts, but that is not what is going on, no?

Do we even need that new varible in the first place?  I am wondering
if you can just do the print "\n" right where you assign to that
variable.

When $confirm is set to 'never', you have both $needs_separtor and
$prompt_separator set.  Would it mean you'd have two extra blank
lines for that message?

All these questions you should have been able to avoided with a bit
more helpful explanation in the proposed log message, I hope.

Thanks.

>  	if ($quiet) {
>  		printf($dry_run ? __("Dry-Sent %s\n") : __("Sent %s\n"), $subject);
>  	} else {


  reply	other threads:[~2024-04-08 21:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07 10:48 [PATCH v5 0/3] send-email: make produced outputs more readable Dragan Simic
2024-04-07 10:48 ` [PATCH v5 1/3] send-email: move newline character out of a translatable string Dragan Simic
2024-04-07 10:48 ` [PATCH v5 2/3] send-email: make it easy to discern the messages for each patch Dragan Simic
2024-04-08 21:08   ` Junio C Hamano
2024-04-09  3:37     ` Dragan Simic
2024-04-07 10:48 ` [PATCH v5 3/3] send-email: separate the confirmation prompts from the messages Dragan Simic
2024-04-08 21:21   ` Junio C Hamano [this message]
2024-04-09  3:25     ` Dragan Simic
2024-04-10  3:53       ` Dragan Simic
2024-04-10  6: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=xmqq1q7fa6u7.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=code@khaugsbakk.name \
    --cc=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    /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).