Re: [PATCH] send-email: add proper default sender
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Nov 12, 2012, 23:42 UTC
- Message-ID
- <CAMP44s0emar-C27SX-FDsUVB6Sevuy4fBFHuO2OD6xELCEjmGg@mail.gmail.com>
- In-Reply-To
- <20121112233546.GG10531@sigill.intra.peff.net>
On Tue, Nov 13, 2012 at 12:35 AM, Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> On Sun, Nov 11, 2012 at 06:06:50PM +0100, Felipe Contreras wrote: > >> There's no point in asking this over and over if the user already >> properly configured his/her name and email. >> >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> >> --- >> >> I got really tired of 'git send-email' always asking me from which address to send mails... that's already configured. > > It should be defaulting to your regular git ident, and you just have to > hit enter, right?
Yes.
> I think it's probably reasonable to skip that "enter" in most cases. But > I'm not sure why we ever asked in the first place. What do people input > there if they are not taking the default?
Beats me.
> Why not use Git::ident_person() here? It saves some code, and would also > respect environment variables. Or better yet...
I assume there was a reason why that code was asking for input; precisely because it would use the environment variables. For some reason the user might have exported GIT_AUTHOR_EMAIL, or maybe EMAIL is not right, or the full name config.
OTOH user.name/.email configurations come clearly from the user.
Show 6 quoted lines
>> my $prompting = 0;
>> if (!defined $sender) {
>> $sender = $repoauthor || $repocommitter || '';
>
> Why not just use $repoauthor or $repocommitter, as the prompt default
> already does?See above.
Cheers.
-- Felipe Contreras