Re: [PATCH/RFC] add git credential login to remote mediawiki
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jun 12, 2012, 14:51 UTC
- Message-ID
- <vpq8vfsoa6x.fsf@bauges.imag.fr>
- In-Reply-To
- <1339512125-32761-1-git-send-email-Javier.Roucher-Iglesias@ensimag.imag.fr>
Javier.Roucher-Iglesias@ensimag.imag.fr writes:
> # MediaWiki API instance, created lazily.
> +sub run_credential {How is the code related to the comment right above?
> + my $Prog = "git credential $op"; > + open2 (*Reader, *Writer, $Prog); > + print Writer $msg; > + close (Writer);
No space before "(" for function calls (already mentionned twice).> my $mediawiki;
Didn't I already mention (twice?) that this declaration was meant to stay right above mw_connect_maybe?
> + run_credential("reject");
> +# exit 1;Do you, or do you not want to "exit 1". Either remove this, or uncomment it.
> sub mw_connect_maybe {
> +
> if ($mediawiki) {Why do you add this blank line? (already mentionned)
Show 16 quoted lines
> - if ($wiki_login) {
> - if (!$mediawiki->login({
> - lgname => $wiki_login,
> - lgpassword => $wiki_passwd,
> - lgdomain => $wiki_domain,
> - })) {
> - print STDERR "Failed to log in mediawiki user \"$wiki_login\" on $url\n";
> - print STDERR "(error " .
> - $mediawiki->{error}->{code} . ': ' .
> - $mediawiki->{error}->{details} . ")\n";
> - exit 1;
> - } else {
> - print STDERR "Logged in with user \"$wiki_login\".\n";
> - }
> - }
> + ask_credential();This means you can't use the wiki anonymously anymore. This is an unacceptable regression.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/