Re: [PATCH] t6423-merge-rename-directories.sh: use the $(...) construct for command substitution
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Feb 22, 2022, 14:06 UTC
- Message-ID
- <d9634657-1cd1-7daa-0b95-85b540f0dc75@github.com>
- In-Reply-To
- <20220222084646.115147-1-gitter.spiros@gmail.com>
On 2/22/2022 3:46 AM, Elia Pinto wrote:
Show 8 quoted lines
> 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?
Show 6 quoted lines
> The patch was generated by:
>
> for _f in $(find . -name "*.sh")
> do
> shellcheck -i SC2006 -f diff ${_f} | ifne git apply -p2
> doneHaving 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