{"thread":{"id":"32102","subject":"[PATCH] send-email: stop asking when we have an ident","startedAt":"2012-11-13T19:19:24Z","lastAt":"2012-11-13T19:19:24Z","messageCount":1,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"203134","messageId":"1352834364-2674-1-git-send-email-felipe.contreras@gmail.com","threadId":"32102","inReplyTo":null,"subject":"[PATCH] send-email: stop asking when we have an ident","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-13T19:19:24Z","receivedAt":"2012-11-13T19:19:24Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Felipe Contreras 2nd <felipe.contreras+2@gmail.com>\n\nCurrently we keep getting questions even when the user has properly\nconfigured his full name and password:\n\n Who should the emails appear to be from?\n [Felipe Contreras <felipe.contreras@gmail.com>]\n\nAnd once a question pops up, other questions are turned on. This is\nannoying.\n\nThe reason this is safe is because currently the script fails completely\nwhen the autohor (or committer) is not correct, so we won't even be\nreaching this point in the code.\n\nThe scenarios, and the current situation:\n\n1) No information at all, no fully qualified domain name\n\nfatal: empty ident name (for <felipec@nysa.(none)>) not allowed\n\n2) Only full name\n\nfatal: unable to auto-detect email address (got 'felipec@nysa.(none)')\n\n3) Full name + fqdm\n\nWho should the emails appear to be from?\n[Felipe Contreras <felipec@nysa.felipec.org>]\n\n4) Full name + EMAIL\n\nWho should the emails appear to be from?\n[Felipe Contreras <felipe.contreras@gmail.com>]\n\n5) User configured\n6) GIT_COMMITTER\n7) GIT_AUTHOR\n\nAll these are the same as 4)\n\nAfter this patch:\n\n1) 2) won't change: git send-email would still die\n\n4) 5) 6) 7) will change: git send-email won't ask the user\n\nThis is good, that's what we would expect, because the identity is\nexplicit.\n\n3) will change: git send-email won't ask the user\n\nThis is bad, because we will try with an address such as\n'felipec@nysa.felipec.org', which is most likely not what the user\nwants, but the user will get warned by default, and if not, most likley\nthe sending won't work, which the user can easily fix.\n\nThe worst possible scenario is that such a mail address does work, and\nthe user sends an email from that addres unintentionally, when in fact\nthe user expected to correct that address in the propmpt.\n\nThis is a very, very, very unlikely scenario, with many dependencies:\n\n1) No configured user.name/user.email\n2) No specified $EMAIL\n3) No configured sendemail.from\n4) No specified --from argument\n5) A fully qualified domain name\n6) A full name in the geckos field\n7) A sendmail configuration that allows sending from this domain name\n8) confirm=never, or\n8.1) confirm configuration not hitting, or\n8.2) Getting the error, not being aware of it\n9) The user expecting to correct this address in the prompt\n\nIn a more likely scenario where 7) is not the case (can't send from\nnysa.felipec.org), the user will simply see the mail was not sent\nproperly, and fix the problem.\n\nThe much more likely scenario though, is where 5) is not the case\n(nysa.(none)), and git send-email will fail right away like it does now.\n\nSo the likelyhood of this affecting anybody seriously is very very slim,\nand the chances of this affecting somebody slightly are still very\nsmall. The vast majority, if not all, of git users won't be affected\nnegatively, and a lot will benefit from this.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-send-email.perl | 7 +------\n 1 file changed, 1 insertion(+), 6 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex aea66a0..503e551 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -748,16 +748,11 @@ if (!$force) {\n \t}\n }\n \n-my $prompting = 0;\n if (!defined $sender) {\n \t$sender = $repoauthor || $repocommitter || '';\n-\t$sender = ask(\"Who should the emails appear to be from? [$sender] \",\n-\t              default => $sender,\n-\t\t      valid_re => qr/\\@.*\\./, confirm_only => 1);\n-\tprint \"Emails will be sent from: \", $sender, \"\\n\";\n-\t$prompting++;\n }\n \n+my $prompting = 0;\n if (!@initial_to && !defined $to_cmd) {\n \tmy $to = ask(\"Who should the emails be sent to (if any)? \",\n \t\t     default => \"\",\n-- \n1.8.0\n"}]}