git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-remote-mediawiki: Fix a bug in a regexp
@ 2013-06-08 13:35 Célestin Matte
  2013-06-08 18:38 ` Matthieu Moy
  2013-06-09  5:11 ` Eric Sunshine
  0 siblings, 2 replies; 6+ messages in thread
From: Célestin Matte @ 2013-06-08 13:35 UTC (permalink / raw)
  To: git; +Cc: benoit.person, matthieu.moy, Célestin Matte

In Perl, '\n' is not a newline, but instead a literal backslash followed by an
"n". As the output of "rev-list --first-parent" is line-oriented, what we want
here is a newline.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
---
 contrib/mw-to-git/git-remote-mediawiki.perl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index 7af202f..a06bc31 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -1190,7 +1190,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);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-09  5:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-08 13:35 [PATCH] git-remote-mediawiki: Fix a bug in a regexp Célestin Matte
2013-06-08 18:38 ` Matthieu Moy
2013-06-08 20:08   ` Célestin Matte
2013-06-09  2:57   ` Jeff King
2013-06-09  5:21     ` Eric Sunshine
2013-06-09  5:11 ` Eric Sunshine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).