[PATCH 01/18] Follow perlcritic's recommendations - level 5 and 4

2013-06-06 Thread Célestin Matte
Fix warnings from perlcritic's level 5 and 4. They correspond to the following cases: - always end a submodule with a return - don't use the constant pragma, use the Readonly module instead - some syntax details for maps, and others. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed

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

2013-06-06 Thread Célestin Matte
put it. I'm not sure of what's happening and what's the best solution for this. I checked Documentation/CodingGuidelines and none of these modifications should contradict it. This is my first patch, so don't hesitate to point to me anything wrong with it. Célestin Matte (18): Follow

[PATCH 02/18] Change style of some regular expressions to make them clearer

2013-06-06 Thread Célestin Matte
- Remove m modifier when useless (m// and // was used randomly; this makes the code more coherent) - Remove stringy split (split('c', ...) instead of split(/c/, ...)) - Use {}{} instead of /// when slashes or used inside the regexp so as not to escape it. Signed-off-by: Célestin Matte celestin.ma

[PATCH 10/18] Put long code into a submodule

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 44 --- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/contrib/mw-to-git/git-remote

[PATCH 04/18] Prevent local variable $url to have the same name as a global variable

2013-06-06 Thread Célestin Matte
There is already a global variable called $url. Changing the name of the local variable prevents future possible misunderstanding. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH 03/18] Add newline in the end of die() error messages

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH 13/18] Remove unless statements and replace them by negated if statements

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH 18/18] Clearly rewrite double dereference

2013-06-06 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 12 ++-- 1 file changed, 6

[PATCH 09/18] Check return value of open and remove import of unused open2

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close

2013-06-06 Thread Célestin Matte
to properly exit when a print or open call fails. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/mw-to-git

[PATCH 05/18] Turn double-negated expressions into simple expressions

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH 12/18] Brace file handles for print for more clarity

2013-06-06 Thread Célestin Matte
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! Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble

[PATCH 15/18] Put non-trivial numeric values (e.g., different from 0, 1 and 2) in constants.

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl

[PATCH 08/18] Explicitely assign local variable as undef and make a proper one-instruction-by- line indentation

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw

[PATCH 11/18] Modify strings for a better coding-style

2013-06-06 Thread Célestin Matte
with qq() so that the quotes do not have to be escaped Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 250 +-- 1 file changed, 124 insertions(+), 126

[PATCH 06/18] Remove unused variable

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH 07/18] Rename a variable ($last) so that it does not have the name of a keyword

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH 14/18] Don't use quotes for empty strings

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

[PATCH 16/18] Fix a typo (mediwiki instead of mediawiki)

2013-06-06 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

Re: [PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close

2013-06-06 Thread Célestin Matte
, but print ones are not, although it should be. So, either: - we use autodie and remove checking of existing return values, or - we don't use autodie and add checking of return value of print calls - or I'm missing some point :) -- Célestin Matte -- To unsubscribe from this list: send the line

Re: git diff bug?

2013-06-06 Thread Célestin Matte
Le 06/06/2013 23:26, Sarma Tangirala a écrit : Hello All, If I did 'git diff HEAD^..HEAD -- file' should git not report some kind of warning if it could not match the file? For example, if 'file' were infact 'dir/file' and 'file' were unique, would it not be a good idea to report that in

Re: [PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close

2013-06-06 Thread Célestin Matte
Le 06/06/2013 23:58, Junio C Hamano a écrit : Célestin Matte celestin.ma...@ensimag.fr writes: So using autodie may not be a good idea. But the problem is that in the current state, open() return values are checked, but print ones are not, although it should be. I tried man autodie

Re: [PATCH 01/18] Follow perlcritic's recommendations - level 5 and 4

2013-06-07 Thread Célestin Matte
this be integrated in the current patch or added as an independant patch? -- 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 05/18] Turn double-negated expressions into simple expressions

2013-06-07 Thread Célestin Matte
Le 07/06/2013 06:12, Eric Sunshine a écrit : On Thu, Jun 6, 2013 at 3:34 PM, Célestin Matte celestin.ma...@ensimag.fr wrote: Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl

Re: [PATCH 05/18] Turn double-negated expressions into simple expressions

2013-06-07 Thread Célestin Matte
case, simplify doubly-negated expressions is quite conceptually distinct from emit more precise diagnostics. (Textually the changes may happen to overlap, but conceptually they are unrelated.) OK, I will do another patch. -- Célestin Matte -- To unsubscribe from this list: send the line

[PATCH v2 00/22] git-remote-mediawiki: Follow perlcritic's recommandations

2013-06-07 Thread Célestin Matte
v2 of patch to follow perlcritic's recommandations ([1]) Changes with v1: - split first commit into 6 different commits - remove commit [17/18] about moving open() call - took every other comment into account [1]: http://thread.gmane.org/gmane.comp.version-control.git/226533 Célestin Matte (22

[PATCH v2 01/22] git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8)

2013-06-07 Thread Célestin Matte
Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH v2 02/22] git-remote-mediawiki: Use the Readonly module instead of the constant pragma

2013-06-07 Thread Célestin Matte
Follow ValuesAndExpressions::ProhibitConstantPragma Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 26 +- 1 file changed, 13 insertions(+), 13 deletions

[PATCH v2 05/22] git-remote-mediawiki: Change syntax of map calls

2013-06-07 Thread Célestin Matte
Put first parameter of map inside a block, for better readability. Follow BuiltinFunctions::RequireBlockMap Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 14 -- 1

[PATCH v2 06/22] git-remote-mediawiki: Rewrite unclear line of instructions

2013-06-07 Thread Célestin Matte
Subroutines' parameters should be affected 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr

[PATCH v2 09/22] git-remote-mediawiki: Change the name of a variable

2013-06-07 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote

[PATCH v2 11/22] git-remote-mediawiki: Remove unused variable $entry

2013-06-07 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v2 04/22] git-remote-mediawiki: Move a variable declaration at the top of the code

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

[PATCH v2 18/22] git-remote-mediawiki: Replace unless statements with negated if statements

2013-06-07 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v2 17/22] git-remote-mediawiki: Brace file handles for print for more clarity

2013-06-07 Thread Célestin Matte
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! Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble

[PATCH v2 08/22] git-remote-mediawiki: Add newline in the end of die() error messages

2013-06-07 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v2 19/22] git-remote-mediawiki: Don't use quotes for empty strings

2013-06-07 Thread Célestin Matte
Empty strings are replaced by an $EMPTY constant. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff

[PATCH v2 07/22] git-remote-mediawiki: Change style of some regular expressions

2013-06-07 Thread Célestin Matte
/ /, which changes its behaviour: the old method matched a run of whtespaces (/\s*/), while the new one will match a single whitespace, which is what we want here. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git

[PATCH v2 20/22] git-remote-mediawiki: Put non-trivial numeric values in constants.

2013-06-07 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git

[PATCH v2 14/22] git-remote-mediawiki: Check return value of open + remove import of unused open2

2013-06-07 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v2 22/22] git-remote-mediawiki: Clearly rewrite double dereference

2013-06-07 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 12 ++-- 1 file changed, 6

[PATCH v2 03/22] git-remote-mediawiki: Always end a subroutine with a return

2013-06-07 Thread Célestin Matte
Follow Subroutines::RequireFinalReturn Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 18 insertions(+) diff --git a/contrib/mw-to-git/git

[PATCH] git-remote-mediawiki: Fix a bug in a regexp

2013-06-08 Thread 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.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr

Re: [PATCH v2 14/22] git-remote-mediawiki: Check return value of open + remove import of unused open2

2013-06-08 Thread Célestin Matte
own patch. -- 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 v2 14/22] git-remote-mediawiki: Check return value of open + remove import of unused open2

2013-06-08 Thread Célestin Matte
Le 08/06/2013 20:41, Matthieu Moy a écrit : Célestin Matte celestin.ma...@ensimag.fr writes: Le 08/06/2013 02:14, Eric Sunshine a écrit : These two changes are unrelated and could be split into distinct patches (IMHO, though others may disagree). Two distinct patches or two distinct

Re: [PATCH] git-remote-mediawiki: Fix a bug in a regexp

2013-06-08 Thread Célestin Matte
, and not the \n string. -- 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 v2 16/22] git-remote-mediawiki: Modify strings for a better coding-style

2013-06-08 Thread Célestin Matte
Le 08/06/2013 02:39, Eric Sunshine a écrit : On Fri, Jun 7, 2013 at 5:42 PM, Célestin Matte celestin.ma...@ensimag.fr wrote: - strings which don't need interpolation are single-quoted for more clarity and slight gain of performance - interpolation is preferred over concatenation in many

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

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

[PATCH v3 02/28] git-remote-mediawiki: Move use warnings; before any instruction

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

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

2013-06-09 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |5 - 1 file changed, 4

[PATCH v3 07/28] git-remote-mediawiki: Rewrite unclear line of instructions

2013-06-09 Thread Célestin Matte
Subroutines' parameters should be affected 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr

[PATCH v3 20/28] git-remote-mediawiki: remove import of unused open2

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v3 00/28] Follow perlcritic's recommandations

2013-06-09 Thread Célestin Matte
(with has been renames Make a regexp clearer), which had been sent as a separate patch, is reintegrated into this series of patches. 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

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

2013-06-09 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git

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

2013-06-09 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |8 1 file changed, 4

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

2013-06-09 Thread Célestin Matte
with qq() so that the quotes do not have to be escaped Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 242 +-- 1 file changed, 120 insertions(+), 122

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

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v3 24/28] git-remote-mediawiki: Replace unless statements with negated if statements

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

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

2013-06-09 Thread Célestin Matte
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! Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble

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

2013-06-09 Thread Célestin Matte
Empty strings are replaced by an $EMPTY constant. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff

[PATCH v3 27/28] git-remote-mediawiki: Fix a typo (mediwiki instead of mediawiki)

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

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

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v3 12/28] git-remote-mediawiki: Change style in a regexp

2013-06-09 Thread Célestin Matte
Change '[\n]' to '\n': brackets are useless here. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mw

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

2013-06-09 Thread Célestin Matte
Follow Subroutines::RequireFinalReturn Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 18 insertions(+) diff --git a/contrib/mw-to-git/git

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

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v3 11/28] git-remote-mediawiki: Change style in a regexp

2013-06-09 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |2

[PATCH v3 19/28] git-remote-mediawiki: Check return value of open

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v3 01/28] git-remote-mediawiki: Make a regexp clearer

2013-06-09 Thread Célestin Matte
. Using the traditional slash-delimiters makes this easier to read. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2013-06-09 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote

[PATCH v3 16/28] git-remote-mediawiki: Remove unused variable $entry

2013-06-09 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[PATCH v3 06/28] git-remote-mediawiki: Change syntax of map calls

2013-06-09 Thread Célestin Matte
Put first parameter of map inside a block, for better readability. Follow BuiltinFunctions::RequireBlockMap Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 14 -- 1

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

2013-06-09 Thread Célestin Matte
Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions

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

2013-06-09 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl

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

2013-06-09 Thread Célestin Matte
, 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw

Re: [PATCH v3 22/28] git-remote-mediawiki: Modify strings for a better coding-style

2013-06-10 Thread Célestin Matte
rather than a show of preference on my part.) Same as above, I tried to change it but didn't know the exact syntax, so I gave up. -- 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

Re: [PATCH v3 22/28] git-remote-mediawiki: Modify strings for a better coding-style

2013-06-10 Thread Célestin Matte
Le 10/06/2013 10:37, Matthieu Moy a écrit : Célestin Matte celestin.ma...@ensimag.fr writes: @@ -1285,8 +1285,7 @@ sub get_mw_namespace_id { # Look at configuration file, if the record for that namespace is # already cached. Namespaces are stored in form

Re: [PATCH 1/2] rm: better error message on failure for multiple files

2013-06-10 Thread Célestin Matte
)), files_staged.buf); Typo here: fileand - file and -- 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] Documentation/CommunityGuidelines

2013-06-10 Thread Célestin Matte
Le 10/06/2013 15:28, Ramkumar Ramachandra a écrit : 0. You do not take offense, no matter what. If someone attacks you irrationally, you do not respond. This is a public mailing list, and we are all rational people: the attacker has already humiliated herself in public, and everyone can see

Re: [PATCH v3 00/28] Follow perlcritic's recommandations

2013-06-11 Thread Célestin Matte
So, do I send a last version of the patch? What is left is quick fix: - removing whitespace in [18/28] - typo in [09/28] - better line split in [22/28] I already fixed first two problems, so it would be done rapidly. -- Célestin Matte -- To unsubscribe from this list: send the line unsubscribe

[PATCH] git-remote-mediawiki: display message when launched directly

2013-06-11 Thread Célestin Matte
Users may be confused when they run the perl script directly. A good way to detect this is to check the number of parameters used to call the script, which is never different from 2 in a normal use. Display a proper error message to avoid any confusion. Signed-off-by: Célestin Matte celestin.ma

Re: [PATCH v3 07/28] git-remote-mediawiki: Rewrite unclear line of instructions

2013-06-11 Thread Célestin Matte
think the second method is clearer when there is only one argument, because it makes it clear that there is only one. -- 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

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

2013-06-11 Thread Célestin Matte
ones - Patch [17/22] was *not* split: tell me if it is necessary - Remove wrong change 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

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git

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

2013-06-11 Thread Célestin Matte
with qq() so that the quotes do not have to be escaped Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 247 +-- 1 file changed, 123 insertions(+), 124

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

2013-06-11 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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mw

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |8 1 file changed, 4

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

2013-06-11 Thread Célestin Matte
. Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote-mediawiki.perl

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

2013-06-11 Thread Célestin Matte
Signed-off-by: Célestin Matte celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- 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

[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 celestin.ma...@ensimag.fr Signed-off-by: Matthieu Moy matthieu@grenoble-inp.fr --- contrib/mw-to-git/git-remote

  1   2   >