path: root/contrib/mw-to-git
diff options
authorCélestin Matte <>2013-06-14 13:50:09 (GMT)
committerJunio C Hamano <>2013-06-14 16:02:15 (GMT)
commit05d4c7b1c46b7a6cbc8f4c0403a6e208aea1c63c (patch)
tree4fe0c10cbb124eddb259c26538f7bf71cd17b881 /contrib/mw-to-git
parentbdff0e3a374617dce784f801b97500d9ba2e4705 (diff)
git-remote-mediawiki: make a regexp clearer
Perl's split function takes a regex pattern argument. You can also feed it an expression, which is then compiled into a regex at runtime. It therefore works to pass your pattern via single quotes, but it is much less obvious to a reader that the argument is meant to be a regex, not a static string. Using the traditional slash-delimiters makes this easier to read. Signed-off-by: Célestin Matte <> Signed-off-by: Matthieu Moy <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib/mw-to-git')
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index 7173872..882da1b 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -1170,7 +1170,7 @@ sub mw_push_revision {
# history (linearized with --first-parent)
print STDERR "Warning: no common ancestor, pushing complete history\n";
my $history = run_git("rev-list --first-parent --children $local");
- my @history = split('\n', $history);
+ my @history = split(/\n/, $history);
@history = @history[1..$#history];
foreach my $line (reverse @history) {
my @commit_info_split = split(/ |\n/, $line);