On Thu, Nov 15, 2012 at 9:33 AM, Jeff King <p...@peff.net> wrote:
> On Thu, Nov 15, 2012 at 03:08:42AM +0100, Felipe Contreras wrote:
>
>> 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.

>> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to