From: Junio C Hamano Date: Thu, 22 Nov 2007 08:48:53 GMT Subject: Re: [PATCH] Authenticate only once in git-send-email Message-ID: <7vwssa7jii.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1195648505-21653-1-git-send-email-win@wincent.com> Wincent Colaiuta writes: > This commit teaches git-send-email to authenticate once and only once at > the beginning of the series. Ok. What does $smtp->auth() return? Presumably a true value, but I do not find it the best coding style to hide a call made primarily for its effects not for its return value behind a conditional assignment to a boolean. Eek. > if ((defined $smtp_authuser) && (defined $smtp_authpass)) { > - $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message; > + $auth ||= $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message; > } Perhaps something along the lines of... > if ((defined $smtp_authuser) && (defined $smtp_authpass)) { > $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message; > + undef $smtp_authpass; > } ... or using a separate boolean variable "my $auth_happened" may be more appropriate. But I am just saying this; I do not care _too_ deeply about it. Will apply as-is.