From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?C=C3=A9lestin=20Matte?= Subject: [PATCH v4 01/31] git-remote-mediawiki: Make a regexp clearer Date: Wed, 12 Jun 2013 00:17:52 +0200 Message-ID: <1370989102-24942-2-git-send-email-celestin.matte@ensimag.fr> References: <1370989102-24942-1-git-send-email-celestin.matte@ensimag.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: benoit.person@ensimag.fr, matthieu.moy@grenoble-inp.fr, =?UTF-8?q?C=C3=A9lestin=20Matte?= To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Jun 12 00:21:01 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UmWw0-00006V-Us for gcvg-git-2@plane.gmane.org; Wed, 12 Jun 2013 00:21:01 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757578Ab3FKWU5 convert rfc822-to-quoted-printable (ORCPT ); Tue, 11 Jun 2013 18:20:57 -0400 Received: from mx2.imag.fr ([129.88.30.17]:46209 "EHLO rominette.imag.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999Ab3FKWSk (ORCPT ); Tue, 11 Jun 2013 18:18:40 -0400 Received: from ensimag.imag.fr (ensimag.imag.fr [195.221.228.12]) by rominette.imag.fr (8.13.8/8.13.8) with ESMTP id r5BMIZvW025999 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Jun 2013 00:18:35 +0200 Received: from ensibm.imag.fr (ensibm.imag.fr [195.221.228.8]) by ensimag.imag.fr (8.13.8/8.13.8/ImagV2.1.r_ens) with ESMTP id r5BMIcf3023977; Wed, 12 Jun 2013 00:18:38 +0200 Received: from tohwi-K50IE.imag.fr (ensibm [195.221.228.8]) by ensibm.imag.fr (8.13.8/8.13.8/ImagV2.1.sb_ens.pm) with ESMTP id r5BMIb2L018360; Wed, 12 Jun 2013 00:18:38 +0200 X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370989102-24942-1-git-send-email-celestin.matte@ensimag.fr> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (rominette.imag.fr [129.88.30.17]); Wed, 12 Jun 2013 00:18:35 +0200 (CEST) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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=C3=A9lestin Matte Signed-off-by: Matthieu Moy --- 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-t= o-git/git-remote-mediawiki.perl index 410eae9..a7bb397 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 =3D run_git("rev-list --first-parent --children $local")= ; - my @history =3D split('\n', $history); + my @history =3D split(/\n/, $history); @history =3D @history[1..$#history]; foreach my $line (reverse @history) { my @commit_info_split =3D split(/ |\n/, $line); --=20 1.7.9.5