{"thread":{"id":"38257","subject":"[PATCH v3] send-email: Improve format of smtp initialization error message","startedAt":"2014-12-29T17:53:21Z","lastAt":"2015-01-04T09:39:52Z","messageCount":5,"participants":["Alexander Kuleshov","Junio C Hamano","Alex Kuleshov"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"254143","messageId":"1419875601-20836-1-git-send-email-kuleshovmail@gmail.com","threadId":"38257","inReplyTo":null,"subject":"[PATCH v3] send-email: Improve format of smtp initialization error message","fromName":"Alexander Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2014-12-29T17:53:21Z","receivedAt":"2014-12-29T17:53:21Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n---\n git-send-email.perl | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 82c6fea..60dcd8d 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1275,10 +1275,10 @@ X-Mailer: git-send-email $gitversion\n \n \t\tif (!$smtp) {\n \t\t\tdie \"Unable to initialize SMTP properly. Check config and use --smtp-debug. \",\n-\t\t\t    \"VALUES: server=$smtp_server \",\n-\t\t\t    \"encryption=$smtp_encryption \",\n-\t\t\t    \"hello=$smtp_domain\",\n-\t\t\t    defined $smtp_server_port ? \" port=$smtp_server_port\" : \"\";\n+\t\t\t    \"\\nVALUES: \\n\\tserver=$smtp_server \",\n+\t\t\t    \"\\n\\tencryption=$smtp_encryption \",\n+\t\t\t    \"\\n\\thello=$smtp_domain\",\n+\t\t\t    defined $smtp_server_port ? \" \\n\\tport=$smtp_server_port\" : \"\";\n \t\t}\n \n \t\tsmtp_auth_maybe or die $smtp->message;\n-- \n2.2.1.201.gbbcefff.dirty\n"},{"id":"254147","messageId":"xmqqppb2z3w9.fsf@gitster.dls.corp.google.com","threadId":"38257","inReplyTo":"1419875601-20836-1-git-send-email-kuleshovmail@gmail.com","subject":"Re: [PATCH v3] send-email: Improve format of smtp initialization error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-29T18:50:46Z","receivedAt":"2014-12-29T18:50:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Kuleshov <kuleshovmail@gmail.com> writes:\n\n> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n> ---\n>  git-send-email.perl | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 82c6fea..60dcd8d 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1275,10 +1275,10 @@ X-Mailer: git-send-email $gitversion\n>  \n>  \t\tif (!$smtp) {\n>  \t\t\tdie \"Unable to initialize SMTP properly. Check config and use --smtp-debug. \",\n> -\t\t\t    \"VALUES: server=$smtp_server \",\n> -\t\t\t    \"encryption=$smtp_encryption \",\n> -\t\t\t    \"hello=$smtp_domain\",\n> -\t\t\t    defined $smtp_server_port ? \" port=$smtp_server_port\" : \"\";\n> +\t\t\t    \"\\nVALUES: \\n\\tserver=$smtp_server \",\n> +\t\t\t    \"\\n\\tencryption=$smtp_encryption \",\n> +\t\t\t    \"\\n\\thello=$smtp_domain\",\n> +\t\t\t    defined $smtp_server_port ? \" \\n\\tport=$smtp_server_port\" : \"\";\n\nIt may be a good convention to have LF at the beginning of a new\nstring (i.e. we terminate the old line only when we have something\nmore to say), but that is true only when we want to end the sentence\nwithout the final newline.  I wonder if that is true in this case;\ndo we want perl to say \"at line # in file X\" at the end?\n\nIn any case, you have two output lines that ends with a trailing SP\njust before LF, which is probably not what you wanted.\n\nIf we want to see all lines end with LF, it may be far easier to\nread this way:\n\n\tdie \"msg\\n\",\n            \"\\tvar1=val1\\n\",\n            \"\\tvar2=val2\\n\",\n            defined $var3 ? \"\\tvar3=val3\\n\" : \"\";\n\nI dunno.\n"},{"id":"254197","messageId":"87iogt4d53.fsf@gmail.com","threadId":"38257","inReplyTo":"xmqqppb2z3w9.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v3] send-email: Improve format of smtp initialization error message","fromName":"Alex Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2014-12-30T10:59:04Z","receivedAt":"2014-12-30T10:59:04Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"What's about output like this:\n\nUnable to initialize SMTP properly. Check config and use --smtp-debug.\n\nVALUES:\n\tserver=smtp.gmail.com\n\tencryption=\n\thello=localhost.localdomain\n\tport=587\n\nJunio C Hamano <gitster@pobox.com> @ 2014-12-30 00:50 QYZT:\n\n> Alexander Kuleshov <kuleshovmail@gmail.com> writes:\n>\n>> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n>> ---\n>>  git-send-email.perl | 8 ++++----\n>>  1 file changed, 4 insertions(+), 4 deletions(-)\n>>\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index 82c6fea..60dcd8d 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1275,10 +1275,10 @@ X-Mailer: git-send-email $gitversion\n>>\n>>  \t\tif (!$smtp) {\n>>  \t\t\tdie \"Unable to initialize SMTP properly. Check config and use --smtp-debug. \",\n>> -\t\t\t    \"VALUES: server=$smtp_server \",\n>> -\t\t\t    \"encryption=$smtp_encryption \",\n>> -\t\t\t    \"hello=$smtp_domain\",\n>> -\t\t\t    defined $smtp_server_port ? \" port=$smtp_server_port\" : \"\";\n>> +\t\t\t    \"\\nVALUES: \\n\\tserver=$smtp_server \",\n>> +\t\t\t    \"\\n\\tencryption=$smtp_encryption \",\n>> +\t\t\t    \"\\n\\thello=$smtp_domain\",\n>> +\t\t\t    defined $smtp_server_port ? \" \\n\\tport=$smtp_server_port\" : \"\";\n>\n> It may be a good convention to have LF at the beginning of a new\n> string (i.e. we terminate the old line only when we have something\n> more to say), but that is true only when we want to end the sentence\n> without the final newline.  I wonder if that is true in this case;\n> do we want perl to say \"at line # in file X\" at the end?\n>\n> In any case, you have two output lines that ends with a trailing SP\n> just before LF, which is probably not what you wanted.\n>\n> If we want to see all lines end with LF, it may be far easier to\n> read this way:\n>\n> \tdie \"msg\\n\",\n>             \"\\tvar1=val1\\n\",\n>             \"\\tvar2=val2\\n\",\n>             defined $var3 ? \"\\tvar3=val3\\n\" : \"\";\n>\n> I dunno.\n\n--\nBest regards.\n0xAX\n"},{"id":"254199","messageId":"xmqqa925t8sl.fsf@gitster.dls.corp.google.com","threadId":"38257","inReplyTo":"87iogt4d53.fsf@gmail.com","subject":"Re: [PATCH v3] send-email: Improve format of smtp initialization error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-30T16:13:46Z","receivedAt":"2014-12-30T16:13:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Kuleshov <kuleshovmail@gmail.com> writes:\n\n> What's about output like this:\n>\n> Unable to initialize SMTP properly. Check config and use --smtp-debug.\n>\n> VALUES:\n> \tserver=smtp.gmail.com\n> \tencryption=\n> \thello=localhost.localdomain\n> \tport=587\n\nHmmm, maybe I am being slow but what's about it?  I thought that was\nwhat you are trying to give with your patch since the first\niteration.\n\nPuzzled...\n\n>\n> Junio C Hamano <gitster@pobox.com> @ 2014-12-30 00:50 QYZT:\n>\n>> Alexander Kuleshov <kuleshovmail@gmail.com> writes:\n>>\n>>> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n>>> ---\n>>>  git-send-email.perl | 8 ++++----\n>>>  1 file changed, 4 insertions(+), 4 deletions(-)\n>>>\n>>> diff --git a/git-send-email.perl b/git-send-email.perl\n>>> index 82c6fea..60dcd8d 100755\n>>> --- a/git-send-email.perl\n>>> +++ b/git-send-email.perl\n>>> @@ -1275,10 +1275,10 @@ X-Mailer: git-send-email $gitversion\n>>>\n>>>  \t\tif (!$smtp) {\n>>>  \t\t\tdie \"Unable to initialize SMTP properly. Check config and use --smtp-debug. \",\n>>> -\t\t\t    \"VALUES: server=$smtp_server \",\n>>> -\t\t\t    \"encryption=$smtp_encryption \",\n>>> -\t\t\t    \"hello=$smtp_domain\",\n>>> -\t\t\t    defined $smtp_server_port ? \" port=$smtp_server_port\" : \"\";\n>>> +\t\t\t    \"\\nVALUES: \\n\\tserver=$smtp_server \",\n>>> +\t\t\t    \"\\n\\tencryption=$smtp_encryption \",\n>>> +\t\t\t    \"\\n\\thello=$smtp_domain\",\n>>> +\t\t\t    defined $smtp_server_port ? \" \\n\\tport=$smtp_server_port\" : \"\";\n>>\n>> It may be a good convention to have LF at the beginning of a new\n>> string (i.e. we terminate the old line only when we have something\n>> more to say), but that is true only when we want to end the sentence\n>> without the final newline.  I wonder if that is true in this case;\n>> do we want perl to say \"at line # in file X\" at the end?\n>>\n>> In any case, you have two output lines that ends with a trailing SP\n>> just before LF, which is probably not what you wanted.\n>>\n>> If we want to see all lines end with LF, it may be far easier to\n>> read this way:\n>>\n>> \tdie \"msg\\n\",\n>>             \"\\tvar1=val1\\n\",\n>>             \"\\tvar2=val2\\n\",\n>>             defined $var3 ? \"\\tvar3=val3\\n\" : \"\";\n>>\n>> I dunno.\n>\n> --\n> Best regards.\n> 0xAX\n"},{"id":"254275","messageId":"CANCZXo4OAjo8o95RoC-RXjOS1ZsMApaNQ46-shvoBOmVmV1uQQ@mail.gmail.com","threadId":"38257","inReplyTo":"xmqqa925t8sl.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v3] send-email: Improve format of smtp initialization error message","fromName":"Alexander Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2015-01-04T09:39:52Z","receivedAt":"2015-01-04T09:39:52Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"Yes, like this, but is it suitable for:\n\n>>      die \"msg\\n\",\n>>             \"\\tvar1=val1\\n\",\n>>             \"\\tvar2=val2\\n\",\n>>             defined $var3 ? \"\\tvar3=val3\\n\" : \"\";\n\n?\n\nI finally got confused, how to print it...\n\n\n2014-12-30 22:13 GMT+06:00 Junio C Hamano <gitster@pobox.com>:\n> Alex Kuleshov <kuleshovmail@gmail.com> writes:\n>\n>> What's about output like this:\n>>\n>> Unable to initialize SMTP properly. Check config and use --smtp-debug.\n>>\n>> VALUES:\n>>       server=smtp.gmail.com\n>>       encryption=\n>>       hello=localhost.localdomain\n>>       port=587\n>\n> Hmmm, maybe I am being slow but what's about it?  I thought that was\n> what you are trying to give with your patch since the first\n> iteration.\n>\n> Puzzled...\n>\n>>\n>> Junio C Hamano <gitster@pobox.com> @ 2014-12-30 00:50 QYZT:\n>>\n>>> Alexander Kuleshov <kuleshovmail@gmail.com> writes:\n>>>\n>>>> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n>>>> ---\n>>>>  git-send-email.perl | 8 ++++----\n>>>>  1 file changed, 4 insertions(+), 4 deletions(-)\n>>>>\n>>>> diff --git a/git-send-email.perl b/git-send-email.perl\n>>>> index 82c6fea..60dcd8d 100755\n>>>> --- a/git-send-email.perl\n>>>> +++ b/git-send-email.perl\n>>>> @@ -1275,10 +1275,10 @@ X-Mailer: git-send-email $gitversion\n>>>>\n>>>>             if (!$smtp) {\n>>>>                     die \"Unable to initialize SMTP properly. Check config and use --smtp-debug. \",\n>>>> -                       \"VALUES: server=$smtp_server \",\n>>>> -                       \"encryption=$smtp_encryption \",\n>>>> -                       \"hello=$smtp_domain\",\n>>>> -                       defined $smtp_server_port ? \" port=$smtp_server_port\" : \"\";\n>>>> +                       \"\\nVALUES: \\n\\tserver=$smtp_server \",\n>>>> +                       \"\\n\\tencryption=$smtp_encryption \",\n>>>> +                       \"\\n\\thello=$smtp_domain\",\n>>>> +                       defined $smtp_server_port ? \" \\n\\tport=$smtp_server_port\" : \"\";\n>>>\n>>> It may be a good convention to have LF at the beginning of a new\n>>> string (i.e. we terminate the old line only when we have something\n>>> more to say), but that is true only when we want to end the sentence\n>>> without the final newline.  I wonder if that is true in this case;\n>>> do we want perl to say \"at line # in file X\" at the end?\n>>>\n>>> In any case, you have two output lines that ends with a trailing SP\n>>> just before LF, which is probably not what you wanted.\n>>>\n>>> If we want to see all lines end with LF, it may be far easier to\n>>> read this way:\n>>>\n>>>      die \"msg\\n\",\n>>>             \"\\tvar1=val1\\n\",\n>>>             \"\\tvar2=val2\\n\",\n>>>             defined $var3 ? \"\\tvar3=val3\\n\" : \"\";\n>>>\n>>> I dunno.\n>>\n>> --\n>> Best regards.\n>> 0xAX\n\n\n\n-- \n_________________________\n0xAX\n"}]}