git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] send-email: Improve format of smtp initialization error message

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 29, 2014, 18:50 UTC
Message-ID
<xmqqppb2z3w9.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1419875601-20836-1-git-send-email-kuleshovmail@gmail.com>
Alexander Kuleshov <kuleshovmail@gmail.com> writes:
Show 21 quoted lines
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  git-send-email.perl | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 82c6fea..60dcd8d 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1275,10 +1275,10 @@ X-Mailer: git-send-email $gitversion
>  
>  		if (!$smtp) {
>  			die "Unable to initialize SMTP properly. Check config and use --smtp-debug. ",
> -			    "VALUES: server=$smtp_server ",
> -			    "encryption=$smtp_encryption ",
> -			    "hello=$smtp_domain",
> -			    defined $smtp_server_port ? " port=$smtp_server_port" : "";
> +			    "\nVALUES: \n\tserver=$smtp_server ",
> +			    "\n\tencryption=$smtp_encryption ",
> +			    "\n\thello=$smtp_domain",
> +			    defined $smtp_server_port ? " \n\tport=$smtp_server_port" : "";

It may be a good convention to have LF at the beginning of a new string (i.e. we terminate the old line only when we have something more to say), but that is true only when we want to end the sentence without the final newline. I wonder if that is true in this case; do we want perl to say "at line # in file X" at the end?

In any case, you have two output lines that ends with a trailing SP just before LF, which is probably not what you wanted.

If we want to see all lines end with LF, it may be far easier to read this way:

	die "msg\n",
            "\tvar1=val1\n",
            "\tvar2=val2\n",
            defined $var3 ? "\tvar3=val3\n" : "";
I dunno.
Previous: Alexander KuleshovNext: Alex Kuleshov
Message 2 of 5 in “send-email: Improve format of smtp initialization error message”
  1. send-email: Improve format of smtp initialization error messageAlexander Kuleshov, Dec 29, 2014
  2. Junio C HamanoDec 29, 2014
  3. Alex KuleshovDec 30, 2014
  4. Junio C HamanoDec 30, 2014
  5. Alexander KuleshovJan 4, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.