git-remote-mediawiki: don't include HTTP login/password in author

On the MediaWiki side, the author information is just the MediaWiki login of the contributor. The import turns it into login@$wiki_name to create the author's email address on the wiki side. But we don't want this to include the HTTP password if it's present in the URL ... Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matthieu Moy committed Oct 20, 2011 at 19:04 UTC 9fb79503e683c1bff810a78a47c939708af5f6b7
1 file changed +4
contrib/mw-to-git/git-remote-mediawiki
+4
@@ -109,6 +109,10 @@ $dumb_push = ($dumb_push eq "true");
109
110 my $wiki_name = $url;
111 $wiki_name =~ s/[^\/]*:\/\///;
112 +# If URL is like http://user:password@example.com/, we clearly don't
113 +# want the password in $wiki_name. While we're there, also remove user
114 +# and '@' sign, to avoid author like MWUser@HTTPUser@host.com
115 +$wiki_name =~ s/^.*@//;
116
117 # Commands parser
118 my $entry;