git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Michal Nazarewicz <mpn@google.com>, peff@peff.net, git@vger.kernel.org
Subject: Re: [PATCHv4 6/6] git-send-email: use git credential to obtain password
Date: Wed, 27 Feb 2013 08:29:26 -0800	[thread overview]
Message-ID: <7va9qpk9eh.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <vpqy5e9zqe9.fsf@grenoble-inp.fr> (Matthieu Moy's message of "Wed, 27 Feb 2013 17:13:18 +0100")

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Junio C Hamano <gitster@pobox.com> writes:
>
>> diff --git a/git-send-email.perl b/git-send-email.perl
>> index 76bbfc3..c3501d9 100755
>> --- a/git-send-email.perl
>> +++ b/git-send-email.perl
>> @@ -1045,6 +1045,14 @@ sub maildomain {
>>  	return maildomain_net() || maildomain_mta() || 'localhost.localdomain';
>>  }
>>  
>> +sub smtp_host_string {
>> +	if (defined $smtp_server_port) {
>> +		return "$smtp_server:$smtp_server_port";
>> +	} else {
>> +		return $smtp_server;
>> +	}
>> +}
>> +
>>  # Returns 1 if authentication succeeded or was not necessary
>>  # (smtp_user was not specified), and 0 otherwise.
>>  
>> @@ -1065,7 +1073,7 @@ sub smtp_auth_maybe {
>>  	# reject credentials.
>>  	$auth = Git::credential({
>>  		'protocol' => 'smtp',
>> -		'host' => join(':', $smtp_server, $smtp_server_port),
>> +		'host' => smtp_host_string(),
>>  		'username' => $smtp_authuser,
>>  		# if there's no password, "git credential fill" will
>>  		# give us one, otherwise it'll just pass this one.
>> @@ -1188,9 +1196,7 @@ sub send_message {
>>  		else {
>>  			require Net::SMTP;
>>  			$smtp_domain ||= maildomain();
>> -			$smtp ||= Net::SMTP->new((defined $smtp_server_port)
>> -						 ? "$smtp_server:$smtp_server_port"
>> -						 : $smtp_server,
>> +			$smtp ||= Net::SMTP->new(smtp_host_string(),
>>  						 Hello => $smtp_domain,
>>  						 Debug => $debug_net_smtp);
>>  			if ($smtp_encryption eq 'tls' && $smtp) {
>
> Seems obviously correct. I also did a basic test and it worked smoothly.

OK, I'll squash it in.
Thanks.

      reply	other threads:[~2013-02-27 16:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 14:02 [PATCHv4 0/6] git-credential support in git-send-email Michal Nazarewicz
2013-02-12 14:02 ` [PATCHv4 1/6] Git.pm: allow command_close_bidi_pipe to be called as method Michal Nazarewicz
2013-02-12 14:02 ` [PATCHv4 2/6] Git.pm: fix example in command_close_bidi_pipe documentation Michal Nazarewicz
2013-02-12 14:02 ` [PATCHv4 3/6] Git.pm: refactor command_close_bidi_pipe to use _cmd_close Michal Nazarewicz
2013-02-12 18:55   ` Junio C Hamano
2013-02-12 20:48     ` Jeff King
2013-02-12 21:12       ` Michal Nazarewicz
2013-02-12 21:17         ` Junio C Hamano
2013-02-12 14:02 ` [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe Michal Nazarewicz
2013-02-12 20:51   ` Jeff King
2013-02-12 21:13     ` Michal Nazarewicz
2013-02-12 21:14     ` Junio C Hamano
2013-02-12 21:17       ` Jeff King
2013-02-12 22:50       ` Michal Nazarewicz
2013-02-12 14:02 ` [PATCHv4 5/6] Git.pm: add interface for git credential command Michal Nazarewicz
2013-02-27 14:18   ` Matthieu Moy
2013-02-12 14:02 ` [PATCHv4 6/6] git-send-email: use git credential to obtain password Michal Nazarewicz
2013-02-27 14:20   ` Matthieu Moy
2013-02-27 15:54     ` Junio C Hamano
2013-02-27 16:09       ` Michal Nazarewicz
2013-02-27 16:13       ` Matthieu Moy
2013-02-27 16:29         ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7va9qpk9eh.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=mpn@google.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).