summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2013-06-23Merge branch 'cm/remote-mediawiki-perlcritique'Junio C Hamano
* cm/remote-mediawiki-perlcritique: (31 commits) git-remote-mediawiki: make error message more precise git-remote-mediawiki: add a perlcritic rule in Makefile git-remote-mediawiki: add a .perlcriticrc file git-remote-mediawiki: clearly rewrite double dereference git-remote-mediawiki: fix a typo ("mediwiki" instead of "mediawiki") git-remote-mediawiki: put non-trivial numeric values in constants. git-remote-mediawiki: don't use quotes for empty strings git-remote-mediawiki: replace "unless" statements with negated "if" statements git-remote-mediawiki: brace file handles for print for more clarity git-remote-mediawiki: modify strings for a better coding-style git-remote-mediawiki: put long code into a subroutine git-remote-mediawiki: remove import of unused open2 git-remote-mediawiki: check return value of open git-remote-mediawiki: assign a variable as undef and make proper indentation git-remote-mediawiki: rename a variable ($last) which has the name of a keyword git-remote-mediawiki: remove unused variable $entry git-remote-mediawiki: turn double-negated expressions into simple expressions git-remote-mediawiki: change the name of a variable git-remote-mediawiki: add newline in the end of die() error messages git-remote-mediawiki: change style in a regexp ...
2013-06-23Merge branch 'bp/remote-mw-tests'Junio C Hamano
* bp/remote-mw-tests: git-remote-mediawiki: remove hardcoded version number in the test suite
2013-06-23Merge branch 'rr/prompt-rebase-breakage-fix'Junio C Hamano
* rr/prompt-rebase-breakage-fix: prompt: squelch error output from cat
2013-06-21Sync with maintJunio C Hamano
* maint: completion: complete diff --word-diff
2013-06-21completion: complete diff --word-diffRamkumar Ramachandra
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-20Merge branch 'cm/remote-mediawiki'Junio C Hamano
* cm/remote-mediawiki: git-remote-mediawiki: display message when launched directly
2013-06-14git-remote-mediawiki: remove hardcoded version number in the test suiteBenoit Person
Updates the code to make it more easy to switch mediawiki version when testing. Before that, the version number was partly hardcoded, partly in a var. Signed-off-by: Benoit Person <benoit.person@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: make error message more preciseCé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. Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: add a perlcritic rule in MakefileCé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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: add a .perlcriticrc fileCé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 <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: clearly rewrite double dereferenceCélestin Matte
@$var structures are re-written in the following way: @{$var} It makes them more readable. Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: fix a typo ("mediwiki" instead of "mediawiki")Célestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: put non-trivial numeric values in constants.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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: don't use quotes for empty stringsCélestin Matte
Empty strings are replaced by an $EMPTY constant. Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: replace "unless" statements with negated "if" statementsCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: brace file handles for print for more clarityCé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 other arguments. When you put braces around any of the special package-level file handles like `STDOUT', `STDERR', and `DATA', you must the `'*'' sigil or else it won't compile under `use strict 'subs''. print $FH "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! Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: modify strings for a better coding-styleCé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 with qq() so that the quotes do not have to be escaped Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: put long code into a subroutineCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: remove import of unused open2Célestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: check return value of openCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: assign a variable as undef and make proper indentationCélestin Matte
Explicitly assign local variable $/ as undef and make a proper one-instruction-by-line indentation Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: rename a variable ($last) which has the name of a keywordCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: remove unused variable $entryCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: turn double-negated expressions into simple expressionsCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: change the name of a variableCé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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: add newline in the end of die() error messagesCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: change style in a regexpCélestin Matte
Change '[\n]' to '\n': brackets are useless here. Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: change style in a regexpCé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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: change separator of some regexpsCé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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: change the behaviour of a splitCé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 split(' ') to split(/ /) 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 <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: remove useless regexp modifier (m)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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: rewrite unclear line of instructionsCé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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: change syntax of map callsCélestin Matte
Put first parameter of map inside a block, for better readability. Follow BuiltinFunctions::RequireBlockMap Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: move a variable declaration at the top of the codeCélestin Matte
%basetimestamps declaration was lost in the middle of subroutines Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: always end a subroutine with a returnCélestin Matte
Follow Subroutines::RequireFinalReturn Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: replace :utf8 by :encoding(UTF-8)Célestin Matte
Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: move "use warnings;" before any instructionCélestin Matte
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14git-remote-mediawiki: make a regexp clearerCé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 string. Using the traditional slash-delimiters makes this easier to read. Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14Merge branch 'rr/complete-difftool-fixup'Junio C Hamano
"git difftool" can take both revs to be compared and pathspecs. "git show" takes revs, revs:path and pathspecs. * rr/complete-difftool-fixup: completion: show can take both revlist and paths completion: difftool takes both revs and files
2013-06-14Merge branch 'bp/mediawiki-credential'Junio C Hamano
The bridge to MediaWiki has been updated to use the credential helper interface in Git.pm, losing its own and the original implementation the former was based on. * bp/mediawiki-credential: git-remote-mediawiki: use Git.pm functions for credentials
2013-06-14Merge branch 'rr/remove-contrib-some'Junio C Hamano
Remove stale contrib/ material. * rr/remove-contrib-some: contrib: drop blameview/ directory contrib: remove continuous/ and patches/
2013-06-14prompt: squelch error output from catRamkumar Ramachandra
The files $g/rebase-{merge,apply}/{head-name,msgnum,end} are not guaranteed to exist. When attempting to cat them, squelch the error output. In addition to guarding against stray directories, this patch addresses a real problem: # on terminal 1 $ git rebase -i master # ignore editor, and switch to terminal 2 cat: .git/rebase-merge/msgnum: No such file or directory cat: .git/rebase-merge/end: No such file or directory $ Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-12contrib: drop blameview/ directoryJeff King
Blameview was a quick-and-dirty demonstration of how blame's incremental output could be used in an interface. These days one can find much better (and less ugly!) demonstrations in "git gui blame" and "tig blame". The only advantage blameview has is that its code is perhaps simpler to read. However, that is balanced by the fact that it probably has bugs, as nobody uses it nor has touched the code in 6 years. An implementor is probably better off just reading the "incremental output" section of "man git-blame". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11git-remote-mediawiki: display message when launched directlyCé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.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11Merge branch 'mm/mediawiki-https-fail-message'Junio C Hamano
Hint users when https:// connection failed to check the certificate. * mm/mediawiki-https-fail-message: git-remote-mediawiki: better error message when HTTP(S) access fails
2013-06-11Merge branch 'xq/credential-osxkeychain'Junio C Hamano
* xq/credential-osxkeychain: credential-osxkeychain: support more protocols
2013-06-11Merge branch 'fc/remote-bzr'Junio C Hamano
* fc/remote-bzr: remote-bzr: add fallback check for a partial clone remote-bzr: reorganize the way 'wanted' works remote-bzr: trivial cleanups remote-bzr: change global repo remote-bzr: delay cloning/pulling remote-bzr: simplify get_remote_branch() remote-bzr: fix for files with spaces remote-bzr: recover from failed clones
2013-06-11Merge branch 'fc/remote-hg'Junio C Hamano
* fc/remote-hg: (50 commits) remote-hg: add support for --force remote-hg: add support for --dry-run remote-hg: check if a fetch is needed remote-hg: trivial cleanup remote-helpers: improve marks usage remote-hg: add check_push() helper remote-hg: add setup_big_push() helper remote-hg: remove files before modifications remote-hg: improve lightweight tag author remote-hg: use remote 'default' not local one remote-hg: improve branch listing remote-hg: simplify branch_tip() remote-hg: check diverged bookmarks remote-hg: pass around revision refs remote-hg: implement custom checkheads() remote-hg: implement custom push() remote-hg: only update necessary revisions remote-hg: force remote bookmark push selectively remote-hg: reorganize bookmark handling remote-hg: add test for failed double push ...
2013-06-11Merge branch 'fc/completion-less-ls-remote'Junio C Hamano
* fc/completion-less-ls-remote: completion: avoid ls-remote in certain scenarios
2013-06-09completion: show can take both revlist and pathsRamkumar Ramachandra
The 'git show' completion uses __git_complete_file (aliased to __git_complete_revlist_file), because accepts <tree-ish>:<path> as well as <commit-ish>. But the command also accepts range of commits in A..B notation, so using __git_complete_revlist_file is more appropriate. There still remain two users of __git_complete_file, completions for "archive" and "ls-tree". As these commands do not take range notation, and "git show" no longer uses __git_complete_file, the implementation of it can be updated not to complete ranges, but that is a separate topic. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>