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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 6, 2013 at 3:34 PM, Célestin Matte
<celestin.matte@xxxxxxxxxx> 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 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@xxxxxxxxxx>
> Signed-off-by: Matthieu Moy <matthieu.moy@xxxxxxxxxxxxxxx>
> ---
>  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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]