git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Authenticate only once in git-send-email

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 22, 2007, 08:48 UTC
Message-ID
<7vwssa7jii.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1195648505-21653-1-git-send-email-win@wincent.com>
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.
 
Previous: Wincent ColaiutaNext: Wincent Colaiuta
Message 2 of 3 in “Authenticate only once in git-send-email”
  1. Authenticate only once in git-send-emailWincent Colaiuta, Nov 21, 2007
  2. Junio C HamanoNov 22, 2007
  3. Wincent ColaiutaNov 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.