aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/mw-to-git
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2011-10-20 19:04:59 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-20 10:17:14 -0700
commit9fb79503e683c1bff810a78a47c939708af5f6b7 (patch)
treed737d60ee8ddc215b980490849dc7a94e61d983a /contrib/mw-to-git
parent1d6abac9d573d7a40d3e631253b67a7cb07e0d05 (diff)
downloadgit-9fb79503e683c1bff810a78a47c939708af5f6b7.tar.gz
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>
Diffstat (limited to 'contrib/mw-to-git')
-rwxr-xr-xcontrib/mw-to-git/git-remote-mediawiki4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki
index 0b32d18eaa..c18bfa1f15 100755
--- a/contrib/mw-to-git/git-remote-mediawiki
+++ b/contrib/mw-to-git/git-remote-mediawiki
@@ -109,6 +109,10 @@ $dumb_push = ($dumb_push eq "true");
my $wiki_name = $url;
$wiki_name =~ s/[^\/]*:\/\///;
+# If URL is like http://user:password@example.com/, we clearly don't
+# want the password in $wiki_name. While we're there, also remove user
+# and '@' sign, to avoid author like MWUser@HTTPUser@host.com
+$wiki_name =~ s/^.*@//;
# Commands parser
my $entry;