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 <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Célestin Matte committed
Jun 14, 2013 at 15:50 UTC
05d4c7b1c46b7a6cbc8f4c0403a6e208aea1c63c
1 file changed
+1
-1
contrib/mw-to-git/git-remote-mediawiki.perl
+1
-1
@@ -1170,7 +1170,7 @@ sub mw_push_revision {
1170
# history (linearized with --first-parent)
1171
print STDERR "Warning: no common ancestor, pushing complete history\n";
1172
my $history = run_git("rev-list --first-parent --children $local");
1173
- my @history = split('\n', $history);
1173
+ my @history = split(/\n/, $history);
1174
@history = @history[1..$#history];
1175
foreach my $line (reverse @history) {
1176
my @commit_info_split = split(/ |\n/, $line);