git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Derrick Stolee <derrickstolee@github.com>
To: Elia Pinto <gitter.spiros@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] t6423-merge-rename-directories.sh: use the $(...) construct for command substitution
Date: Tue, 22 Feb 2022 09:06:03 -0500	[thread overview]
Message-ID: <d9634657-1cd1-7daa-0b95-85b540f0dc75@github.com> (raw)
In-Reply-To: <20220222084646.115147-1-gitter.spiros@gmail.com>

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

      reply	other threads:[~2022-02-22 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22  8:46 [PATCH] t6423-merge-rename-directories.sh: use the $(...) construct for command substitution Elia Pinto
2022-02-22 14:06 ` Derrick Stolee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9634657-1cd1-7daa-0b95-85b540f0dc75@github.com \
    --to=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitter.spiros@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).