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

2012-07-18 Thread Matthieu Moy
Jeff King writes: > So since that is a non-issue, I think the second diff I provided above > is a bit nicer. I like this one best too. It just lacks a comment saying why it should be displayed first ;-). -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send th

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

2012-07-18 Thread Jeff King
On Wed, Jul 18, 2012 at 02:37:27PM +0200, Matthieu Moy wrote: > Jeff King writes: > > > I started with a version that did that, but there are two complications: > > > > 1. credential_write needs to know that the 'url' field must come > > first, as it overwrites the other fields. So we end

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

2012-07-18 Thread Matthieu Moy
Jeff King writes: > I started with a version that did that, but there are two complications: > > 1. credential_write needs to know that the 'url' field must come > first, as it overwrites the other fields. So we end up > special-casing it either way. Right, I didn't think of that. Bu

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

2012-07-18 Thread Jeff King
On Wed, Jul 18, 2012 at 02:24:13PM +0200, Matthieu Moy wrote: > Jeff King writes: > > > @@ -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 crede

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

2012-07-18 Thread Matthieu Moy
Jeff King writes: > @@ -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; >

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

2012-07-18 Thread Jeff King
We can just feed our URL straight to git-credential and it will parse it for us, saving us some code. Signed-off-by: Jeff King --- contrib/mw-to-git/git-remote-mediawiki | 32 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/contrib/mw-to-git/git-re