[PATCH RFC] git-remote-mediawiki: push-by-rev

2013-06-16 Thread Célestin Matte
From: Célestin Matte Add the push-by-rev option This allows one to look for changes by revision instead of by page. The result is a much faster push on little-activity wikis. Indeed, instead of sending one request by page to check that the remote revision is our local latest revision, we only

[PATCH RFC] git-remote-mediawiki: push-by-rev

2013-06-16 Thread Célestin Matte
From: Célestin Matte This patch intends to introduce the by_rev strategy for the push command, as already available for the fetch one. This uses subroutines used by the fetch-by-rev strategy. I'm not sure it's actually complete: can it be that simple? However, I tested on a local w

[PATCH v6 22/31] git-remote-mediawiki: Modify strings for a better coding-style

2013-06-14 Thread Célestin Matte
From: Célestin Matte - strings which don't need interpolation are single-quoted for more clarity and slight gain of performance - interpolation is preferred over concatenation in many cases, for more clarity - variables are always used with the ${} operator inside strings - strings incl

[PATCH v6 16/31] git-remote-mediawiki: Remove unused variable $entry

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 68df6e4..2cfbc0a

[PATCH v6 17/31] git-remote-mediawiki: Rename a variable ($last) which has the name of a keyword

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH v6 25/31] git-remote-mediawiki: Don't use quotes for empty strings

2013-06-14 Thread Célestin Matte
From: Célestin Matte Empty strings are replaced by an $EMPTY constant. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/contrib/mw-to-git/git

[PATCH v6 23/31] git-remote-mediawiki: Brace file handles for print for more clarity

2013-06-14 Thread Célestin Matte
From: Célestin Matte This follows the following rule: InputOutput::RequireBracedFileHandleWithPrint (Severity: 1) The `print' and `printf' functions have a unique syntax that supports an optional file handle argument. Conway suggests wrapping this argument in braces

[PATCH v6 30/31] git-remote-mediawiki: add a perlcritic rule in Makefile

2013-06-14 Thread Célestin Matte
From: Célestin Matte Option "-2" launches perlcritic with level 2. Levels go from 5 (most pertinent) to 1. Rules of level 1 are mostly a question of style, and are therefore ignored. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/Makefile | 2

[PATCH v6 18/31] git-remote-mediawiki: Assign a variable as undef and make proper indentation

2013-06-14 Thread Célestin Matte
From: Célestin Matte Explicitly assign local variable $/ as undef and make a proper one-instruction-by-line indentation Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v6 19/31] git-remote-mediawiki: Check return value of open

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index

[PATCH v6 26/31] git-remote-mediawiki: Put non-trivial numeric values in constants.

2013-06-14 Thread Célestin Matte
From: Célestin Matte Non-trivial numeric values (e.g., different from 0, 1 and 2) are placed in constants at the top of the code to be easily modifiable and to make more sense Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 20

[PATCH v6 24/31] git-remote-mediawiki: Replace "unless" statements with negated "if" statements

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote

[PATCH v6 31/31] git-remote-mediawiki: Make error message more precise

2013-06-14 Thread Célestin Matte
From: Célestin Matte In subroutine parse_command, error messages were not correct. For the "import" function, having too much or incorrect arguments displayed both "invalid arguments", while it displayed "too many arguments" for the "option" functions und

[PATCH v6 29/31] git-remote-mediawiki: Add a .perlcriticrc file

2013-06-14 Thread Célestin Matte
From: Célestin Matte Such a file allows to configure perlcritic. Here, it is used to remove many unwanted rules and configure one to remove unwanted warnings. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/.perlcriticrc | 28 1

[PATCH v6 11/31] git-remote-mediawiki: Change style in a regexp

2013-06-14 Thread Célestin Matte
From: Célestin Matte In this regexp, ' |\n' is used, whereas its equivalent '[ \n]', which is clearer, is used elsewhere. Make the style coherent. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 2 +- 1 file

[PATCH v6 03/31] git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8)

2013-06-14 Thread Célestin Matte
From: Célestin Matte Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-gi

[PATCH v6 21/31] git-remote-mediawiki: Put long code into a subroutine

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 56 - 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git

[PATCH v6 15/31] git-remote-mediawiki: Turn double-negated expressions into simple expressions

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH v6 14/31] git-remote-mediawiki: Change the name of a variable

2013-06-14 Thread Célestin Matte
From: Célestin Matte Local variable $url has the same name as a global variable. Changing the name of the local variable prevents future possible misunderstanding. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file

[PATCH v6 13/31] git-remote-mediawiki: Add newline in the end of die() error messages

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git

[PATCH v6 27/31] git-remote-mediawiki: Fix a typo ("mediwiki" instead of "mediawiki")

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH v6 10/31] git-remote-mediawiki: Change separator of some regexps

2013-06-14 Thread Célestin Matte
From: Célestin Matte Use {}{} instead of /// when slashes are used inside the regexp so as not to escape it. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH v6 20/31] git-remote-mediawiki: remove import of unused open2

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 82684f3..e3a79db

[PATCH v6 28/31] git-remote-mediawiki: Clearly rewrite double dereference

2013-06-14 Thread Célestin Matte
From: Célestin Matte @$var structures are re-written in the following way: @{$var} It makes them more readable. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v6 02/31] git-remote-mediawiki: Move "use warnings;" before any instruction

2013-06-14 Thread Célestin Matte
From: Célestin Matte Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index

[PATCH v6 12/31] git-remote-mediawiki: Change style in a regexp

2013-06-14 Thread Célestin Matte
From: Célestin Matte Change '[\n]' to '\n': brackets are useless here. Signed-off-by: Célestin 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-remo

[PATCH v6 08/31] git-remote-mediawiki: Remove useless regexp modifier (m)

2013-06-14 Thread Célestin Matte
From: Célestin Matte m// and // is used randomly. It is better to use the m modifier only when needed, e.g., when the regexp uses another separator than //. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3

[PATCH v6 09/31] git-remote-mediawiki: Change the behaviour of a split

2013-06-14 Thread Célestin Matte
From: Célestin Matte A "split ' '" is turned into a "split / /", which changes its behaviour: the old method matched a run of whitespaces (/\s*/), while the new one will match a single space, which is what we want here. Indeed, in other contexts, changing

[PATCH v6 07/31] git-remote-mediawiki: Rewrite unclear line of instructions

2013-06-14 Thread Célestin Matte
From: Célestin Matte Subroutines' parameters should be assigned to variable before doing anything else Besides, existing instruction affected a variable inside a "if", which break Git's coding style Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/

[PATCH v6 04/31] git-remote-mediawiki: Always end a subroutine with a return

2013-06-14 Thread Célestin Matte
From: Célestin Matte Follow Subroutines::RequireFinalReturn Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 18 insertions(+) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib

[PATCH v6 06/31] git-remote-mediawiki: Change syntax of map calls

2013-06-14 Thread Célestin Matte
From: Célestin Matte Put first parameter of map inside a block, for better readability. Follow BuiltinFunctions::RequireBlockMap Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 14 -- 1 file changed, 8 insertions(+), 6

[PATCH v6 05/31] git-remote-mediawiki: Move a variable declaration at the top of the code

2013-06-14 Thread Célestin Matte
From: Célestin Matte %basetimestamps declaration was lost in the middle of subroutines Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git

[PATCH v6 00/31] git-remote-mediawiki: Follow perlcritic's recommandations

2013-06-14 Thread Célestin Matte
From: Célestin Matte A new version of this series of patch, to make it mergeable with next. Changes with v5: - Fix a bug in [21/31] - Build on top of next so that it's mergeable Changes with v4: - fixed typos - Change in [21/31]: all the processing is done within the subroutine Changes

[PATCH v6 01/31] git-remote-mediawiki: Make a regexp clearer

2013-06-14 Thread Célestin Matte
From: Célestin Matte 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

Re: [PATCH v5 00/31] Follow perlcritic's recommandations

2013-06-12 Thread Célestin Matte
er as much as possible, see SubmittingPatches for more details). I will try to do this. -- Célestin Matte -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v5 00/31] Follow perlcritic's recommandations

2013-06-12 Thread Célestin Matte
Le 12/06/2013 22:34, Célestin Matte a écrit : > Le 12/06/2013 22:02, Matthieu Moy a écrit : >> Célestin Matte writes: >> >>> Not many changes since v3. This version is only for fixing last typos and >>> applying Junio's recommandations for [21/31], which

Re: [PATCH v5 00/31] Follow perlcritic's recommandations

2013-06-12 Thread Célestin Matte
Le 12/06/2013 22:02, Matthieu Moy a écrit : > Célestin Matte writes: > >> Not many changes since v3. This version is only for fixing last typos and >> applying Junio's recommandations for [21/31], which I forgot in v4. >> At this point, the only patch worth reviewi

[PATCH v5 12/31] git-remote-mediawiki: Change style in a regexp

2013-06-12 Thread Célestin Matte
Change '[\n]' to '\n': brackets are useless here. Signed-off-by: Célestin 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/c

[PATCH v5 28/31] git-remote-mediawiki: Clearly rewrite double dereference

2013-06-12 Thread Célestin Matte
@$var structures are re-written in the following way: @{$var} It makes them more readable. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/git

[PATCH v5 25/31] git-remote-mediawiki: Don't use quotes for empty strings

2013-06-12 Thread Célestin Matte
Empty strings are replaced by an $EMPTY constant. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b

[PATCH v5 29/31] git-remote-mediawiki: Add a .perlcriticrc file

2013-06-12 Thread Célestin Matte
Such a file allows to configure perlcritic. Here, it is used to remove many unwanted rules and configure one to remove unwanted warnings. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/.perlcriticrc | 28 1 file changed, 28

[PATCH v5 06/31] git-remote-mediawiki: Change syntax of map calls

2013-06-12 Thread Célestin Matte
Put first parameter of map inside a block, for better readability. Follow BuiltinFunctions::RequireBlockMap Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git

[PATCH v5 30/31] git-remote-mediawiki: add a perlcritic rule in Makefile

2013-06-12 Thread Célestin Matte
Option "-2" launches perlcritic with level 2. Levels go from 5 (most pertinent) to 1. Rules of level 1 are mostly a question of style, and are therefore ignored. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/Makefile | 5 - 1 file changed, 4

[PATCH v5 13/31] git-remote-mediawiki: Add newline in the end of die() error messages

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH v5 11/31] git-remote-mediawiki: Change style in a regexp

2013-06-12 Thread Célestin Matte
In this regexp, ' |\n' is used, whereas its equivalent '[ \n]', which is clearer, is used elsewhere. Make the style coherent. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 2 +- 1 file changed, 1 insertion(+),

[PATCH v5 20/31] git-remote-mediawiki: remove import of unused open2

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index d95119f..7acbec8 100755 --- a/contrib/mw

[PATCH v5 15/31] git-remote-mediawiki: Turn double-negated expressions into simple expressions

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 63d1530..6024791

[PATCH v5 08/31] git-remote-mediawiki: Remove useless regexp modifier (m)

2013-06-12 Thread Célestin Matte
m// and // is used randomly. It is better to use the m modifier only when needed, e.g., when the regexp uses another separator than //. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH v5 16/31] git-remote-mediawiki: Remove unused variable $entry

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 6024791..ef9e60a 100755 --- a/contrib/mw

[PATCH v5 14/31] git-remote-mediawiki: Change the name of a variable

2013-06-12 Thread Célestin Matte
Local variable $url has the same name as a global variable. Changing the name of the local variable prevents future possible misunderstanding. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions

[PATCH v5 24/31] git-remote-mediawiki: Replace "unless" statements with negated "if" statements

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 8b0144c

[PATCH v5 07/31] git-remote-mediawiki: Rewrite unclear line of instructions

2013-06-12 Thread Célestin Matte
Subroutines' parameters should be assigned to variable before doing anything else Besides, existing instruction affected a variable inside a "if", which break Git's coding style Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-media

[PATCH v5 26/31] git-remote-mediawiki: Put non-trivial numeric values in constants.

2013-06-12 Thread Célestin Matte
Non-trivial numeric values (e.g., different from 0, 1 and 2) are placed in constants at the top of the code to be easily modifiable and to make more sense Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 20 ++-- 1 file

[PATCH v5 17/31] git-remote-mediawiki: Rename a variable ($last) which has the name of a keyword

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index ef9e60a..0610daa

[PATCH v5 23/31] git-remote-mediawiki: Brace file handles for print for more clarity

2013-06-12 Thread Célestin Matte
Mary had a little lamb\n"; #not ok print {$FH} "Mary had a little lamb\n"; #ok print STDERR $foo, $bar, $baz; #not ok print {STDERR} $foo, $bar, $baz; #won't compile under 'strict' print {*STDERR} $foo, $bar, $baz; #perfect!

[PATCH v5 19/31] git-remote-mediawiki: Check return value of open

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 15ad19b..d95119f

[PATCH v5 21/31] git-remote-mediawiki: Put long code into a subroutine

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 56 - 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote

[PATCH v5 10/31] git-remote-mediawiki: Change separator of some regexps

2013-06-12 Thread Célestin Matte
Use {}{} instead of /// when slashes are used inside the regexp so as not to escape it. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git

[PATCH v5 04/31] git-remote-mediawiki: Always end a subroutine with a return

2013-06-12 Thread Célestin Matte
Follow Subroutines::RequireFinalReturn Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 18 insertions(+) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote

[PATCH v5 03/31] git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8)

2013-06-12 Thread Célestin Matte
Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki

[PATCH v5 09/31] git-remote-mediawiki: Change the behaviour of a split

2013-06-12 Thread Célestin Matte
t(/ /) could potentially be a regression, however, here, when parsing the output of "rev-list --parents", whose output SHA-1's are each separated by a single space, splitting on a single space is perfectly correct. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- con

[PATCH v5 05/31] git-remote-mediawiki: Move a variable declaration at the top of the code

2013-06-12 Thread Célestin Matte
%basetimestamps declaration was lost in the middle of subroutines Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b

[PATCH v5 31/31] git-remote-mediawiki: Make error message more precise

2013-06-12 Thread Célestin Matte
Separate the two error messages in both cases. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git

[PATCH v5 02/31] git-remote-mediawiki: Move "use warnings;" before any instruction

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index a7bb397..863ecc9

[PATCH v5 22/31] git-remote-mediawiki: Modify strings for a better coding-style

2013-06-12 Thread Célestin Matte
itten with qq() so that the quotes do not have to be escaped Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 247 ++-- 1 file changed, 123 insertions(+), 124 deletions(-) diff --git a/contrib/mw-to-git/git-r

[PATCH v5 27/31] git-remote-mediawiki: Fix a typo ("mediwiki" instead of "mediawiki")

2013-06-12 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index f4a63fb..fa24eb1

[PATCH v5 18/31] git-remote-mediawiki: Assign a variable as undef and make proper indentation

2013-06-12 Thread Célestin Matte
Explicitly assign local variable $/ as undef and make a proper one-instruction-by-line indentation Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/mw-to-git

[PATCH v5 01/31] git-remote-mediawiki: Make a regexp clearer

2013-06-12 Thread Célestin Matte
tring. Using the traditional slash-delimiters makes this easier to read. Signed-off-by: Célestin 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/co

[PATCH v5 00/31] Follow perlcritic's recommandations

2013-06-12 Thread Célestin Matte
ge in patch [22/22] Changes with v1: - split first commit into 6 different commits - remove commit [17/18] about moving open() call - took every other comment into account Célestin Matte (31): git-remote-mediawiki: Make a regexp clearer git-remote-mediawiki: Move "use warnings;" before

Re: New feature discussion: git rebase --status

2013-06-12 Thread Célestin Matte
se --continue" once you are satisfied with your changes) # .. # .. I have no idea how complicated it would be to do that, though. What do you think? -- Célestin Matte -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v3 21/28] git-remote-mediawiki: Put long code into a subroutine

2013-06-11 Thread Célestin Matte
} > > while () { > chomp; > if (!parse_command($_)) { > unknown command, aborting > last; > } > } > > -- Célestin Matte -- To unsubscribe from this list: send the line &qu

[PATCH v4 19/31] git-remote-mediawiki: Check return value of open

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 15ad19b..d95119f

[PATCH v4 10/31] git-remote-mediawiki: Change separator of some regexps

2013-06-11 Thread Célestin Matte
Use {}{} instead of /// when slashes are used inside the regexp so as not to escape it. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git

[PATCH v4 18/31] git-remote-mediawiki: Assign a variable as undef and make proper indentation

2013-06-11 Thread Célestin Matte
Explicitly assign local variable $/ as undef and make a proper one-instruction-by-line indentation Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/mw-to

[PATCH v4 04/31] git-remote-mediawiki: Always end a subroutine with a return

2013-06-11 Thread Célestin Matte
Follow Subroutines::RequireFinalReturn Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 18 insertions(+) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote

[PATCH v4 09/31] git-remote-mediawiki: Change the behaviour of a split

2013-06-11 Thread Célestin Matte
t(/ /) could potentially be a regression, however, here, when parsing the output of "rev-list --parents", whose output SHA-1's are each separated by a single space, splitting on a single space is perfectly correct. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- c

[PATCH v4 23/31] git-remote-mediawiki: Brace file handles for print for more clarity

2013-06-11 Thread Célestin Matte
Mary had a little lamb\n"; #not ok print {$FH} "Mary had a little lamb\n"; #ok print STDERR $foo, $bar, $baz; #not ok print {STDERR} $foo, $bar, $baz; #won't compile under 'strict' print {*STDERR} $foo, $bar, $baz; #perfect!

[PATCH v4 11/31] git-remote-mediawiki: Change style in a regexp

2013-06-11 Thread Célestin Matte
In this regexp, ' |\n' is used, whereas its equivalent '[ \n]', which is clearer, is used elsewhere. Make the style coherent. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |2 +- 1 file changed, 1 insertion(+),

[PATCH v4 20/31] git-remote-mediawiki: remove import of unused open2

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |1 - 1 file changed, 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index d95119f..7acbec8 100755 --- a/contrib

[PATCH v4 14/31] git-remote-mediawiki: Change the name of a variable

2013-06-11 Thread Célestin Matte
Local variable $url has the same name as a global variable. Changing the name of the local variable prevents future possible misunderstanding. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions

[PATCH v4 17/31] git-remote-mediawiki: Rename a variable ($last) which has the name of a keyword

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index ef9e60a

[PATCH v4 01/31] git-remote-mediawiki: Make a regexp clearer

2013-06-11 Thread Célestin Matte
tring. Using the traditional slash-delimiters makes this easier to read. Signed-off-by: Célestin 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.pe

[PATCH v4 21/31] git-remote-mediawiki: Put long code into a subroutine

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 50 +-- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote

[PATCH v4 06/31] git-remote-mediawiki: Change syntax of map calls

2013-06-11 Thread Célestin Matte
Put first parameter of map inside a block, for better readability. Follow BuiltinFunctions::RequireBlockMap Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff

[PATCH v4 16/31] git-remote-mediawiki: Remove unused variable $entry

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |1 - 1 file changed, 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 6024791..ef9e60a 100755 --- a/contrib

[PATCH v4 15/31] git-remote-mediawiki: Turn double-negated expressions into simple expressions

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 63d1530

[PATCH v4 13/31] git-remote-mediawiki: Add newline in the end of die() error messages

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH v4 02/31] git-remote-mediawiki: Move "use warnings;" before any instruction

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index a7bb397..863ecc9

[PATCH v4 07/31] git-remote-mediawiki: Rewrite unclear line of instructions

2013-06-11 Thread Célestin Matte
Subroutines' parameters should be assigned to variable before doing anything else Besides, existing instruction affected a variable inside a "if", which break Git's coding style Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-m

[PATCH v4 05/31] git-remote-mediawiki: Move a variable declaration at the top of the code

2013-06-11 Thread Célestin Matte
%basetimestamps declaration was lost in the middle of subroutines Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH v4 08/31] git-remote-mediawiki: Remove useless regexp modifier (m)

2013-06-11 Thread Célestin Matte
m// and // is used randomly. It is better to use the m modifier only when needed, e.g., when the regexp uses another separator than //. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH v4 31/31] git-remote-mediawiki: Make error message more precise

2013-06-11 Thread Célestin Matte
Separate the two error messages in both cases. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/m

[PATCH v4 25/31] git-remote-mediawiki: Don't use quotes for empty strings

2013-06-11 Thread Célestin Matte
Empty strings are replaced by an $EMPTY constant. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b

[PATCH v4 03/31] git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8)

2013-06-11 Thread Célestin Matte
Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/git-r

[PATCH v4 28/31] git-remote-mediawiki: Clearly rewrite double dereference

2013-06-11 Thread Célestin Matte
@$var structures are re-written in the following way: @{$var} It makes them more readable. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/mw-to-git

[PATCH v4 12/31] git-remote-mediawiki: Change style in a regexp

2013-06-11 Thread Célestin Matte
Change '[\n]' to '\n': brackets are useless here. Signed-off-by: Célestin 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

[PATCH v4 30/31] git-remote-mediawiki: add a perlcritic rule in Makefile

2013-06-11 Thread Célestin Matte
Option "-2" launches perlcritic with level 2. Levels go from 5 (most pertinent) to 1. Rules of level 1 are mostly a question of style, and are therefore ignored. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/Makefile |5 - 1 file changed, 4

[PATCH v4 27/31] git-remote-mediawiki: Fix a typo ("mediwiki" instead of "mediawiki")

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 89b2120..6b6adf2

[PATCH v4 24/31] git-remote-mediawiki: Replace "unless" statements with negated "if" statements

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/git-remote-mediawiki.perl | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl index 5174080

[PATCH v4 29/31] git-remote-mediawiki: Add a .perlcriticrc file

2013-06-11 Thread Célestin Matte
Such a file allows to configure perlcritic. Here, it is used to prevent to remove many unwanted rules and configure one to remove unwanted warnings. Signed-off-by: Célestin Matte Signed-off-by: Matthieu Moy --- contrib/mw-to-git/.perlcriticrc | 28 1 file changed

  1   2   >