From patchwork Sun Apr 7 10:48:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13620139 Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 571F21799B for ; Sun, 7 Apr 2024 10:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.91.91 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712486943; cv=none; b=b6l/4T9+I9OXeKlFQLcfXUik+OaBkGwuGXTI4jV3SDoRwvADiKc9JinsGhmO1V0I+OHu5dVbT1f0hnrRrKd2ybDUGN1dJw5O7JY17PCEfQaOInWT3Er3airjsyZDWzwMabnv1Ig8K51GOca08I5zqoz3VJcbVOdfgJUokHxafQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712486943; c=relaxed/simple; bh=LShqhXYQXcBD8Cg/AqNxuLbd90k78u+BJySJB7ZA0G8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qGhwzb12MhxMxWuCa4ywvepPbvUGm7XlFppvdvUAgKT8NzxOKhA1Ny5pMFrtjZqkvbJe2lLpVN0/RwXEycY+X6qn/zmrYPpThl98yLzhwxZ+PkArolNTXJ94BXuQpVRECIWzc4LgCNVOnzR5usCY4wU9kIOdp+6bchMyk94keKw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org; spf=pass smtp.mailfrom=manjaro.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b=xAEVnCWI; arc=none smtp.client-ip=116.203.91.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manjaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b="xAEVnCWI" From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1712486939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U+RThENlRwuFpyiFram//EMu2zAQwhw3C1enONNNzQw=; b=xAEVnCWIgfa4wA5Dg5GLfR3k3qOGIAtoXhQsA+FolJ9S2lI5/r/S11et57s+eqAKHC7ny8 caTwnPWr8xkCRNyW7u89xP02JLcjkuhb6vrO33sdbl3Qw/aKNPd/+WRp2RuX0hQkjaDE21 nbY3/a1NqNLAa1IxqXpOJXtK1McoJElYliJMwa3klcSe3DGAwdHW/ckwMsU3FKiFnCk7IL SfttcfP5tI7Ud1WtOROEciJueWvJfP5bRJV/mR+gp6Q1q+yiCH5LFO+1/RKzeB7w17aF9f W6qm6Y+QK9bBcHCpz3mSk78NN/7ZA/2LR4qFuo/OXDbu6CiKCiHCvzikVz+mDw== To: git@vger.kernel.org Cc: gitster@pobox.com, code@khaugsbakk.name Subject: [PATCH v5 1/3] send-email: move newline character out of a translatable string Date: Sun, 7 Apr 2024 12:48:50 +0200 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org Move the already existing newline character out of a translatable string, to help a bit with the translation efforts. Signed-off-by: Dragan Simic --- git-send-email.perl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index 821b2b3a135a..a22f299ba051 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1686,10 +1686,11 @@ 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"); } + print "\n"; } return 1; From patchwork Sun Apr 7 10:48:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13620140 Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8E381862A for ; Sun, 7 Apr 2024 10:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.91.91 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712486943; cv=none; b=I0q7jc+wd/a5leYZ9fyDgo0VqJVsv8PozFR0gBvtShtYxjUucX4Rj8vTMD/ifbKyjGcdAX+oRBoeOe3mL7ekJNCIg2ddf81q9wlhgTvuITlmwTrYEQH/3CHAnaC37C3x5YY5JEV8pMiQG6Kh0tu86UZgbovc/a/hhJe+fH1XVmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712486943; c=relaxed/simple; bh=PHo3KT87jiyCXkcGSZD+M9TaTZ1C3dcLrQcXtvOAdcY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sY7BwnFBI2nTRVgRYOK+4c34Y0LLTf5i/mjXC55yH8fEOo18NGYFfLNh5aufaV9DcPYAUn97oGWbR5+cZp7LoSVwknHNNinAMuiRUt8AI9EJjxEZCYiVLd3A6qxwCWClULnUuP6fc1HzE3/XsSSgKdguELMSY/IZBcu5QhgISlk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org; spf=pass smtp.mailfrom=manjaro.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b=XmbV4a/Q; arc=none smtp.client-ip=116.203.91.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manjaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b="XmbV4a/Q" From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1712486939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jwXeWqlyVJLpm1VJmdKDiQWySD31rUlcy40p+WzeHX4=; b=XmbV4a/QARm4xLop3HLecFDOSm2XI+UTocfzdghXVPXeCSBDhR5nA5OrPMWspoOgwxcMt8 pQrWtakXRn6k58iNUjYTlvBR5n+OvJkaEoXrSW4gl68+bMHoMh5xmHWifs02Jc4Qq4kd4b yjwfU838JkkZX8mxuEWle3ocvB8ZRnVWf8MKTMcjQF0kkpgWD2sKlxF5IstsG07Y7TNNh1 IBNlUB+4XSwIFr+ym9NsBr/HJUIw+hANBQtqDJJYkPvjJhPQi0sB7ivBlccwj1NmXYeq7l jsHh7CAD9OfUC4/b0jPpuZ+3MHfvDuWuUsiHExDO3BAvvuCwJg0EwEe7JT/Paw== To: git@vger.kernel.org Cc: gitster@pobox.com, code@khaugsbakk.name Subject: [PATCH v5 2/3] send-email: make it easy to discern the messages for each patch Date: Sun, 7 Apr 2024 12:48:51 +0200 Message-Id: <7f87383089011a98b0347d885b3b9d76cfddb91d.1712486910.git.dsimic@manjaro.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org When sending multiple patches at once, without prompting the user to confirm the sending of each patch separately, the displayed result statuses for 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 in the excerpt above, bunching the "Result: " lines together with the messages produced for the subsequent patch makes the output unreadable, which actually becomes worse as the number of patches sent at once increases. To make the produced outputs more readable, add vertical whitespace (more precisely, a newline) between the displayed result statuses and the subsequent messages, as visible in the sample output excerpt below, produced after the addition of vertical whitespace: ... MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Result: 250 OK. Log says: ... These changes don't emit additional vertical whitespace after the result status produced for the last processed patch, i.e. the vertical whitespace is treated as a separator between the groups of produced messages, not as their terminator. This follows the Git's general approach of not wasting the vertical screen space whenever reasonably possible. While there, remove a couple of spotted stray newlines in the source code and convert one indentation from spaces to tabs, for consistency. The associated test, t9001, requires no updates to cover these changes. Helped-by: Junio C Hamano Signed-off-by: Dragan Simic --- git-send-email.perl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index a22f299ba051..4127fbe6b936 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -212,6 +212,7 @@ sub format_2822_time { my $compose_filename; my $force = 0; my $dump_aliases = 0; +my $needs_separator = 0; # Variables to prevent short format-patch options from being captured # as abbreviated send-email options @@ -1361,7 +1362,6 @@ sub smtp_host_string { # Returns 1 if authentication succeeded or was not necessary # (smtp_user was not specified), and 0 otherwise. - sub smtp_auth_maybe { if (!defined $smtp_authuser || $auth || (defined $smtp_auth && $smtp_auth eq "none")) { return 1; @@ -1554,7 +1554,10 @@ sub send_message { exit(0); } elsif (/^a/i) { $confirm = 'never'; + $needs_separator = 1; } + } else { + $needs_separator = 1; } unshift (@sendmail_parameters, @smtp_server_options); @@ -1576,7 +1579,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.") } @@ -1921,7 +1923,8 @@ sub pre_process_file { sub process_file { my ($t) = @_; - pre_process_file($t, $quiet); + pre_process_file($t, $quiet); + print "\n" if ($needs_separator); my $message_was_sent = send_message(); if ($message_was_sent == -1) { From patchwork Sun Apr 7 10:48:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13620141 Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CCD0199BC for ; Sun, 7 Apr 2024 10:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.91.91 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712486944; cv=none; b=ElgXbCST0Py2qEoIm6H5qOw8EdDCXU8F/Mi6ncclAp9poDQzEyw24Q1DICSIsPsRSjdRwdFnrXA4uCMsh3pSLfSh7J+CPhFAbV66kqJB6jkHBR5iFM6GhGy2EEv6/0SUkZbAEJ1mhH/fdbTonJIHJ/ZMVyOf8deUmEePYB292YY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712486944; c=relaxed/simple; bh=KSgRlSAp20SSuLJh1tJKJsopIYU1+m0ov7xxchZRC3w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V+nJzpl7N2iatfUIEFpwZWnoT/5IrDOqv5xZNeBH3eWzDMMQsw2gKStTYFNpjsR0M92waZUUiXiWTVh+fRG+ISPBg662skkpojAuz1FBhp6gqE9barQ18x021uv6X5BUz1kQw4eloEExU8/GUTc9YqSBMJxx6xOsx4Yptk41zsc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org; spf=pass smtp.mailfrom=manjaro.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b=CrJmfzcA; arc=none smtp.client-ip=116.203.91.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manjaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b="CrJmfzcA" From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1712486940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rFLMWYB7AIdX0a0xMZFkLZq+IehkVuP9MGj54xc/a1M=; b=CrJmfzcApD04jUHoQEyMBdU4xlgh5XB+MeD2gCWgAliucUC7Kry6j9hchMlY/8HjarAUJw cd1U/nLKwcJEd07iiPGGw0+n0wIwDWxZ9qJGcOq3e51j4opyv/nuVpDZ6JIPWnZn1TO5gc 7KkC+zS+XsBezBx+N3nNNepGsV+u4uIArxxrcY77V77FHC7bZdHJRzo1lU3vps441J56Nw TSTVvk1UedxI6Q3eyDCGLKM2ypI+GZ7tMavAxAgt/YOJuaSL1ZWLWy3aw8tEe3ndEDE6iU dF07dqtC4OFONMbtSKCEdi4408hdXkJ/wCu3LdqFRC3fwJHk1w2kNEyersCG4g== To: git@vger.kernel.org Cc: gitster@pobox.com, code@khaugsbakk.name Subject: [PATCH v5 3/3] send-email: separate the confirmation prompts from the messages Date: Sun, 7 Apr 2024 12:48:52 +0200 Message-Id: <7b99e5c7c0b0c8d3d7eaaae169e650ebe81964a1.1712486910.git.dsimic@manjaro.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org 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: ... The introduced changes don't emit additional vertical whitespace after the confirmation prompt if the user selects to skip sending the email they were asked about, or if the user selects to quit the procedure entirely. This follows the Git's general approach of not wasting the vertical screen space whenever reasonably possible. The associated test, t9001, requires no updates to cover these changes. Signed-off-by: Dragan Simic --- git-send-email.perl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-send-email.perl b/git-send-email.perl index 4127fbe6b936..a09bc7fd6b96 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1510,6 +1510,7 @@ sub gen_header { 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); if ($quiet) { printf($dry_run ? __("Dry-Sent %s\n") : __("Sent %s\n"), $subject); } else {