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

Re: [PATCH 4/4] mw-to-git: use git-credential's URL parser

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 18, 2012, 12:24 UTC
Message-ID
<vpqd33tjlzm.fsf@bauges.imag.fr>
In-Reply-To
<20120718120656.GD6726@sigill.intra.peff.net>
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/
Previous: Jeff KingNext: Jeff King
Message 8 of 14 in “mediawiki/credential cleanups”
  1. 0/4 mediawiki/credential cleanupsJeff King, Jul 18, 2012
  2. 1/4 docs/credential: minor clarity fixupsJeff King, Jul 18, 2012
  3. 2/4 mw-to-git: check blank credential attributes via lengthJeff King, Jul 18, 2012
  4. 3/4 credential: convert "url" attribute into its parsed subpartsJeff King, Jul 18, 2012
  5. Matthieu MoyJul 18, 2012
  6. Jeff KingJul 18, 2012
  7. 4/4 mw-to-git: use git-credential's URL parserJeff King, Jul 18, 2012
  8. Matthieu MoyJul 18, 2012
  9. Jeff KingJul 18, 2012
  10. Matthieu MoyJul 18, 2012
  11. Jeff KingJul 18, 2012
  12. 4/4 mw-to-git: use git-credential's URL parserJeff King, Jul 18, 2012
  13. Matthieu MoyJul 18, 2012
  14. Matthieu MoyJul 18, 2012

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.