Re: [PATCHv2 8/8] send-email: do not prompt for explicit repo ident
From: Felipe Contreras <hidden>
Date: 2016-06-15 22:55:17
On Thu, Nov 15, 2012 at 9:33 AM, Jeff King [off-list ref] wrote:
On Thu, Nov 15, 2012 at 03:08:42AM +0100, Felipe Contreras wrote:quoted
I don't think there's any need for all that, this does the trick:diff --git a/git-send-email.perl b/git-send-email.perl index aea66a0..503e551 100755 --- a/git-send-email.perl +++ b/git-send-email.perl@@ -748,16 +748,11 @@ if (!$force) { } } -my $prompting = 0; if (!defined $sender) { $sender = $repoauthor || $repocommitter || ''; - $sender = ask("Who should the emails appear to be from? [$sender] ", - default => $sender, - valid_re => qr/\@.*\./, confirm_only => 1); - print "Emails will be sent from: ", $sender, "\n"; - $prompting++; } +my $prompting = 0;This passes all the current tests and the ones you added.It may pass on your system, but it will not on a system that meets the AUTOIDENT prerequisite (it fails the new t9001.19 on my system; I suspect your system config is such that we skip t9001.19 and run t9001.20, whereas mine is the opposite).
I tried both: ok 19 # skip implicit ident prompts for sender (missing AUTOIDENT of PERL,AUTOIDENT) ok 20 - broken implicit ident aborts send-email ok 19 - implicit ident prompts for sender ok 20 # skip broken implicit ident aborts send-email (missing !AUTOIDENT of PERL,!AUTOIDENT) However, it would be much easier if ident learned to check GIT_TEST_FAKE_HOSTNAME, or something. But then I realized I had to run 'make' again. Yes, my patch breaks test 19, but see below.
quoted
Which kind of user will get the prompt with your patch, that would miss it with mine?One whose system is configured in such a way that git can produce an automatic ident (i.e., has a non-blank GECOS name and a FQDN).
And doesn't have any of the following: * configured user.name/user.email * specified $EMAIL * configured sendemail.from * specified --from argument Very unlikely. And then, what would be the consequences of not receiving this prompt? Cheers. -- Felipe Contreras