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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 22/11/2007, a las 9:48, Junio C Hamano escribió:

Wincent Colaiuta <win@xxxxxxxxxxx> 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,

True on success, false on failure.

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.

Of the alternatives you suggest, I think an "$auth_happened" or "$auth_done" flag is probably the nicest/cleanest.

But I am just saying this; I do not care _too_ deeply about it.
Will apply as-is.

Yes, I don't really care either. My reasoning for doing it the way I did is that I'm not much of a Perl hacker so I basically wanted to make the change as minimally invasive as possible (in this case prepending "$auth ||= "). But above all, all that I really care about is that the problem gets fixed.

Cheers,
Wincent


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux