Re: [PATCH 11/18] Modify strings for a better coding-style
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 7, 2013, 04:31 UTC
- Message-ID
- <CAPig+cT+uczSH3SfXR6LuXY+mGMF_9HcpzygjHY1RM83VHyucQ@mail.gmail.com>
- In-Reply-To
- <1370547263-13558-12-git-send-email-celestin.matte@ensimag.fr>
On Thu, Jun 6, 2013 at 3:34 PM, Célestin Matte <celestin.matte@ensimag.fr> wrote:
Show 32 quoted lines
> - 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>
> ---
> contrib/mw-to-git/git-remote-mediawiki.perl | 250 +++++++++++++--------------
> 1 file changed, 124 insertions(+), 126 deletions(-)
>
> diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
> index 1271527..0e2152d 100755
> --- a/contrib/mw-to-git/git-remote-mediawiki.perl
> +++ b/contrib/mw-to-git/git-remote-mediawiki.perl
> @@ -344,10 +344,10 @@ sub get_mw_pages {
> # $out = run_git("command args", "raw"); # don't interpret output as UTF-8.
> sub run_git {
> my $args = shift;
> - my $encoding = (shift || "encoding(UTF-8)");
> - open(my $git, "-|:$encoding", "git " . $args)
> - or die "Unable to open: $!\n";
> - my $res = do {
> + my $encoding = (shift || 'encoding(UTF-8)');
> + my $res = do {
> + open(my $git, "-|:$encoding", "git ${args}")
> + or die "Unable to fork: $!\n";
> local $/ = undef;
> <$git>
> };A change sneaked in here not mentioned by the commit message and not related to the other changes. open() is now inside the do{} block.