Re: [PATCH] t6423-merge-rename-directories.sh: use the $(...) construct for command substitution

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

 



On 2/22/2022 3:46 AM, Elia Pinto wrote:
>     The Git CodingGuidelines prefer the $(...) construct for command
>     substitution instead of using the backquotes `...`.
> 
>     The backquoted form is the traditional method for command
>     substitution, and is supported by POSIX.  However, all but the
>     simplest uses become complicated quickly.  In particular, embedded
>     command substitutions and/or the use of double quotes require
>     careful escaping with the backslash character.

This message has some strange left-padding. Could you reduce that
whitespace for the majority of your message? 

>     The patch was generated by:
> 
>         for _f in $(find . -name "*.sh")
>         do
>            shellcheck -i SC2006 -f diff ${_f} | ifne git apply -p2
>         done

Having some left-padding makes sense for this example.

Also, thanks for sharing this automation!
 
>     and then carefully proof-read.
> -		for i in `git ls-files`; do echo side A >>$i; done &&
> +		for i in $(git ls-files); do echo side A >>$i; done &&

> -		for i in `git ls-files`; do echo side B >>$i; done &&
> +		for i in $(git ls-files); do echo side B >>$i; done &&

> -		for i in `git ls-files`; do echo side A >>$i; done &&
> +		for i in $(git ls-files); do echo side A >>$i; done &&

> -		for i in `git ls-files`; do echo side B >>$i; done &&
> +		for i in $(git ls-files); do echo side B >>$i; done &&

> -		for i in `test_seq 1 88`; do
> +		for i in $(test_seq 1 88); do

These changes make sense. Thanks!
-Stolee



[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