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

2013-06-11 Thread 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 including double-quotes are written

[PATCH v3 1/4] toposort: rename lifo field

2013-06-11 Thread Junio C Hamano
The primary invariant of sort_in_topological_order() is that a parent commit is not emitted until all children of it are. When traversing a forked history like this with git log C E: ABC \ DE we ensure that A is emitted after all of B, C, D, and E are done, B has to

[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 ---

[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

[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 ---

[PATCH v3 2/4] prio-queue: priority queue of pointers to structs

2013-06-11 Thread Junio C Hamano
Traditionally we used a singly linked list of commits to hold a set of in-flight commits while traversing history. The most typical use of the list is to add commits that are newly discovered to it, keep the list sorted by commit timestamp, pick up the newest one from the list, and keep digging.

[PATCH v3 4/4] log: --author-date-order

2013-06-11 Thread Junio C Hamano
Sometimes people would want to view the commits in parallel histories in the order of author dates, not committer dates. Teach topo-order sort machinery to do so, using a commit-info slab to record the author dates of each commit, and prio-queue to sort them. Signed-off-by: Junio C Hamano

[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

[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
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 under the same conditions. Separate the two error messages in both cases.

[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

[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

[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

[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 ---

[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 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

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

2013-06-11 Thread 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 be a regex, not a static

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

2013-06-11 Thread 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 whitespace, which is what we want here. Indeed, in other contexts, changing split(' ') to split(/ /) could potentially be a regression,

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

2013-06-11 Thread 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 to make it visually stand out from the

[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 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

[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 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

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

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

[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 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(+),

[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 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 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 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

[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 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

[PATCH v3 0/4] log --author-date-order

2013-06-11 Thread Junio C Hamano
The first one is unchanged. The second one was redone with Peff's help, and the other two patches have been adjusted for it. Adding tests to t4202 and/or t6012 is left as an exercise to readers. Junio C Hamano (4): toposort: rename lifo field prio-queue: priority queue of pointers to

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

2013-06-11 Thread Célestin Matte
Oops, forgot to take this into account before sending v4 of my series of patch. I just noticed that, sorry... Le 11/06/2013 17:42, Junio C Hamano a écrit : I am guessing that the new sub, parse_command, uses a local @cmd and this is an attempt to avoid using the same name, but this renaming of

What's cooking in git.git (Jun 2013, #04; Tue, 11)

2013-06-11 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. You can find the changes described here in the integration branches of the repositories listed at

[PATCH 0/2] module_list enhancements

2013-06-11 Thread Fredrik Gustafsson
Cleanup and enhanced module_list (see patches for details). All new functionality is in the first patch, the second one deals only with cleanup. I would prefer if both got applied. Fredrik Gustafsson (2): [submodule] handle multibyte characters in name [submodule] Replace perl-code with sh

[PATCH 1/2] [submodule] handle multibyte characters in name

2013-06-11 Thread Fredrik Gustafsson
Bugg reported here: http://thread.gmane.org/gmane.comp.version-control.git/218922/focus=226791 Note that newline (\n) is still not supported and will not be until the sh-script is replaced by something in an other language. This however let us to use mostly all other strange characters.

[PATCH 2/2] [submodule] Replace perl-code with sh

2013-06-11 Thread Fredrik Gustafsson
This is a work built on http://thread.gmane.org/gmane.comp.version-control.git/198873/focus=198930 Basically git-submodule.sh needs to use something else than sh to handle newline in filenames (and therefore needs to use a language that accepts \0 in strings). However, since we're not there yet.

Re: [PATCH] Documentation/CommunityGuidelines

2013-06-11 Thread Felipe Contreras
On Tue, Jun 11, 2013 at 3:55 PM, Junio C Hamano gits...@pobox.com wrote: Jeff King p...@peff.net writes: So there are no hard rules, and this is not a democracy[1]. For the most part the community runs itself in an open and collective fashion, and the dictator's job is easy; but ultimately,

Re: What's cooking in git.git (Jun 2013, #04; Tue, 11)

2013-06-11 Thread Felipe Contreras
On Tue, Jun 11, 2013 at 5:34 PM, Junio C Hamano gits...@pobox.com wrote: * fc/remote-helpers-use-specified-python (2013-05-28) 4 commits - remote-helpers: add exec-path links - remote-helpers: allow direct test execution - remote-helpers: rename tests - remote-helpers: generate scripts

Re: What's cooking in git.git (Jun 2013, #04; Tue, 11)

2013-06-11 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes: On Tue, Jun 11, 2013 at 5:34 PM, Junio C Hamano gits...@pobox.com wrote: * fc/remote-helpers-use-specified-python (2013-05-28) 4 commits - remote-helpers: add exec-path links - remote-helpers: allow direct test execution -

Re: [PATCH] Documentation/CommunityGuidelines

2013-06-11 Thread Felipe Contreras
On Tue, Jun 11, 2013 at 1:43 PM, Michael Haggerty mhag...@alum.mit.edu wrote: On 06/11/2013 08:16 PM, Ramkumar Ramachandra wrote: This is an exercise. I can easily be more tactful (as evidenced by other threads), but I'm choosing not to be. I want you to focus on the argument, and not the

Re: [PATCH] Documentation/CommunityGuidelines

2013-06-11 Thread John Szakmeister
On Tue, Jun 11, 2013 at 3:46 PM, Philip Oakley philipoak...@iee.org wrote: From: Michael Haggerty mhag...@alum.mit.edu Sent: Tuesday, June 11, 2013 7:52 PM [...] That's a very good point (and a good illustration, too). How do you like the new second and third sentences below? * When

[PATCH 3/3] Move create_notes_commit() from notes-merge.c into notes-utils.c

2013-06-11 Thread Johan Herland
create_notes_commit() is needed by both the notes-merge code, and by commit_notes() in notes-utils. Since it is generally useful, and not bound to the notes-merge machinery, we move it from (the more specific) notes-merge to (the more general) notes-utils. Signed-off-by: Johan Herland

[PATCH 2/3] Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c

2013-06-11 Thread Johan Herland
This is a pure code movement of the machinery for copying notes to rewritten objects. This code was located in builtin/notes.c for historical reasons. In order to make it available to builtin/commit.c it was declared in builtin.h. This was more of an accident of history than a concious design, and

[PATCH 1/3] finish_copy_notes_for_rewrite(): Let caller provide commit message

2013-06-11 Thread Johan Herland
When copying notes for a rewritten object, the resulting notes commit would have the following hardcoded commit message: Notes added by 'git notes copy' This is obviously bogus when the notes rewriting is performed by 'git commit --amend'. Therefore, let the caller specify an appropriate

[PATCH 0/3] Refactor useful notes functions into notes-utils.[ch]

2013-06-11 Thread Johan Herland
There is only one right solution. If a useful function is buried in builtin/*.o as a historical accident (i.e. it started its life as a helper for that particular command, and nobody else used it from outside so far) and that makes it impossible to use the function from outside builtin/*.o,

Re: [PATCH 2/3] Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c

2013-06-11 Thread Felipe Contreras
On Tue, Jun 11, 2013 at 7:13 PM, Johan Herland jo...@herland.net wrote: This is a pure code movement of the machinery for copying notes to rewritten objects. This code was located in builtin/notes.c for historical reasons. In order to make it available to builtin/commit.c it was declared in

<    1   2