Re: [PATCH 5/9] send-email: use function syntax instead of barewords

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

 



On Wed, May 12, 2021 at 03:48:21PM +0200, Ævar Arnfjörð Bjarmason wrote:

> Change calls like "__ 'foo'" to "__('foo')" so the Perl compiler
> doesn't have to guess that "__" is a function. This makes the code
> more readable.

I think this is a good change. And while you do qualify it as "more"
readable, I think the main issue with readability here:

> diff --git a/git-send-email.perl b/git-send-email.perl
> index 9ff315f775..da46925aa0 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -678,7 +678,7 @@ sub is_format_patch_arg {
>  		if (defined($format_patch)) {
>  			return $format_patch;
>  		}
> -		die sprintf(__ <<EOF, $f, $f);
> +		die sprintf(__(<<EOF), $f, $f);
>  File '%s' exists but it could also be the range of commits
>  to produce patches for.  Please disambiguate by...

is how far the "EOF" marker is from the actual here-doc, syntactically
(plus the ugly indentation). I suspect this and other places might be
nicer to assign from the here-doc into a well-named variable.

But I think it's fine to leave for now (and I worry a bit that it may
turn into a rabbit hole, so we might be better to just leave it alone
anyway).

-Peff



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

  Powered by Linux