Re: [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution

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

 



On Fri, Sep 18, 2020 at 7:19 AM Denton Liu <liu.denton@xxxxxxxxx> wrote:
> The preferred form for a command substitution is $() over ``. Use this
> form for the command substitution in the sample hook.
>
> Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
> ---
> diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
> @@ -41,7 +41,7 @@ do
> -               commit=`git rev-list -n 1 --grep '^WIP' "$range"`
> +               commit="$(git rev-list -n 1 --grep '^WIP' "$range")"

The double quotes around $(...) are unnecessary and just add noise.

>                 if [ -n "$commit" ]

If you're looking for style fixes, then this would be another
candidate (using 'test' instead of '[').



[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