Re: [PATCH 4/4] mw-to-git: use git-credential's URL parser
Jeff King <peff@peff.net> writes:
Show 23 quoted lines
> @@ -216,7 +190,9 @@ sub credential_write {
> sub credential_run {
> my $op = shift;
> my $credential = shift;
> + my $url = shift;
> my $pid = open2(my $reader, my $writer, "git credential $op");
> + print $writer "url=$url\n" if defined $url;
> credential_write($credential, $writer);
> print $writer "\n";
> close($writer);
> @@ -246,10 +222,10 @@ sub mw_connect_maybe {
> $mediawiki = MediaWiki::API->new;
> $mediawiki->{config}->{api_url} = "$url/api.php";
> if ($wiki_login) {
> - my %credential = credential_from_url($url);
> + my %credential;
> $credential{username} = $wiki_login;
> $credential{password} = $wiki_passwd;
> - credential_run("fill", \%credential);
> + credential_run("fill", \%credential, $url);
> my $request = {lgname => $credential{username},
> lgpassword => $credential{password},
> lgdomain => $wiki_domain};I would find it more elegant not to special-case the URL field, and just
my %credential = ('url' => $url);but I'm fine with your version too.
Other than that, and for the 4 patches of the serie:
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/