From: Junio C Hamano <gitster@pobox.com>
To: Wincent Colaiuta <win@wincent.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Authenticate only once in git-send-email
Date: Thu, 22 Nov 2007 00:48:53 -0800 [thread overview]
Message-ID: <7vwssa7jii.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1195648505-21653-1-git-send-email-win@wincent.com> (Wincent Colaiuta's message of "Wed, 21 Nov 2007 13:35:05 +0100")
Wincent Colaiuta <win@wincent.com> 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.
next prev parent reply other threads:[~2007-11-22 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-21 12:35 [PATCH] Authenticate only once in git-send-email Wincent Colaiuta
2007-11-22 8:48 ` Junio C Hamano [this message]
2007-11-22 10:07 ` Wincent Colaiuta
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vwssa7jii.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=win@wincent.com \
/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.
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 NNTP newsgroup(s).