git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] send-email: Improve format of smtp initialization error message
@ 2014-12-29 17:53 Alexander Kuleshov
  2014-12-29 18:50 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kuleshov @ 2014-12-29 17:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Thomas Gummerer, Eric Sunshine, Alexander Kuleshov

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" : "";
 		}
 
 		smtp_auth_maybe or die $smtp->message;
-- 
2.2.1.201.gbbcefff.dirty

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] send-email: Improve format of smtp initialization error message
  2014-12-29 17:53 [PATCH v3] send-email: Improve format of smtp initialization error message Alexander Kuleshov
@ 2014-12-29 18:50 ` Junio C Hamano
  2014-12-30 10:59   ` Alex Kuleshov
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2014-12-29 18:50 UTC (permalink / raw)
  To: Alexander Kuleshov; +Cc: git, Thomas Gummerer, Eric Sunshine

Alexander Kuleshov <kuleshovmail@gmail.com> writes:

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] send-email: Improve format of smtp initialization error message
  2014-12-29 18:50 ` Junio C Hamano
@ 2014-12-30 10:59   ` Alex Kuleshov
  2014-12-30 16:13     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kuleshov @ 2014-12-30 10:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alexander Kuleshov, git, Thomas Gummerer, Eric Sunshine

What's about output like this:

Unable to initialize SMTP properly. Check config and use --smtp-debug.

VALUES:
	server=smtp.gmail.com
	encryption=
	hello=localhost.localdomain
	port=587

Junio C Hamano <gitster@pobox.com> @ 2014-12-30 00:50 QYZT:

> Alexander Kuleshov <kuleshovmail@gmail.com> writes:
>
>> 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.

--
Best regards.
0xAX

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] send-email: Improve format of smtp initialization error message
  2014-12-30 10:59   ` Alex Kuleshov
@ 2014-12-30 16:13     ` Junio C Hamano
  2015-01-04  9:39       ` Alexander Kuleshov
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2014-12-30 16:13 UTC (permalink / raw)
  To: Alex Kuleshov; +Cc: git, Thomas Gummerer, Eric Sunshine

Alex Kuleshov <kuleshovmail@gmail.com> writes:

> What's about output like this:
>
> Unable to initialize SMTP properly. Check config and use --smtp-debug.
>
> VALUES:
> 	server=smtp.gmail.com
> 	encryption=
> 	hello=localhost.localdomain
> 	port=587

Hmmm, maybe I am being slow but what's about it?  I thought that was
what you are trying to give with your patch since the first
iteration.

Puzzled...

>
> Junio C Hamano <gitster@pobox.com> @ 2014-12-30 00:50 QYZT:
>
>> Alexander Kuleshov <kuleshovmail@gmail.com> writes:
>>
>>> 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.
>
> --
> Best regards.
> 0xAX

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] send-email: Improve format of smtp initialization error message
  2014-12-30 16:13     ` Junio C Hamano
@ 2015-01-04  9:39       ` Alexander Kuleshov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Kuleshov @ 2015-01-04  9:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git@vger.kernel.org, Thomas Gummerer, Eric Sunshine

Yes, like this, but is it suitable for:

>>      die "msg\n",
>>             "\tvar1=val1\n",
>>             "\tvar2=val2\n",
>>             defined $var3 ? "\tvar3=val3\n" : "";

?

I finally got confused, how to print it...


2014-12-30 22:13 GMT+06:00 Junio C Hamano <gitster@pobox.com>:
> Alex Kuleshov <kuleshovmail@gmail.com> writes:
>
>> What's about output like this:
>>
>> Unable to initialize SMTP properly. Check config and use --smtp-debug.
>>
>> VALUES:
>>       server=smtp.gmail.com
>>       encryption=
>>       hello=localhost.localdomain
>>       port=587
>
> Hmmm, maybe I am being slow but what's about it?  I thought that was
> what you are trying to give with your patch since the first
> iteration.
>
> Puzzled...
>
>>
>> Junio C Hamano <gitster@pobox.com> @ 2014-12-30 00:50 QYZT:
>>
>>> Alexander Kuleshov <kuleshovmail@gmail.com> writes:
>>>
>>>> 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.
>>
>> --
>> Best regards.
>> 0xAX



-- 
_________________________
0xAX

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-04  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-29 17:53 [PATCH v3] send-email: Improve format of smtp initialization error message Alexander Kuleshov
2014-12-29 18:50 ` Junio C Hamano
2014-12-30 10:59   ` Alex Kuleshov
2014-12-30 16:13     ` Junio C Hamano
2015-01-04  9:39       ` Alexander Kuleshov

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 NNTP newsgroup(s).