git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: derrickstolee@github.com, Elia Pinto <gitter.spiros@gmail.com>
Subject: [PATCH v2] t6423-merge-rename-directories.sh: use the $(...) construct
Date: Sun, 13 Mar 2022 17:28:29 +0000	[thread overview]
Message-ID: <20220313172829.215517-1-gitter.spiros@gmail.com> (raw)

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.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	shellcheck -i SC2006 -f diff ${_f} | ifne git apply -p2
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
This is version 2 of the patch.

In this one, only the commit message is reformatted
https://lore.kernel.org/all/20220222084646.115147-1-gitter.spiros@gmail.com/t/#md1eb17764414c2a26421b1213ee084912c434d3b

 t/t6423-merge-rename-directories.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index 5b81a130e9..479db32cd6 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -4421,14 +4421,14 @@ test_setup_12c1 () {
 
 		git checkout A &&
 		git mv node2/ node1/ &&
-		for i in `git ls-files`; do echo side A >>$i; done &&
+		for i in $(git ls-files); do echo side A >>$i; done &&
 		git add -u &&
 		test_tick &&
 		git commit -m "A" &&
 
 		git checkout B &&
 		git mv node1/ node2/ &&
-		for i in `git ls-files`; do echo side B >>$i; done &&
+		for i in $(git ls-files); do echo side B >>$i; done &&
 		git add -u &&
 		test_tick &&
 		git commit -m "B"
@@ -4511,7 +4511,7 @@ test_setup_12c2 () {
 
 		git checkout A &&
 		git mv node2/ node1/ &&
-		for i in `git ls-files`; do echo side A >>$i; done &&
+		for i in $(git ls-files); do echo side A >>$i; done &&
 		git add -u &&
 		echo leaf5 >node1/leaf5 &&
 		git add node1/leaf5 &&
@@ -4520,7 +4520,7 @@ test_setup_12c2 () {
 
 		git checkout B &&
 		git mv node1/ node2/ &&
-		for i in `git ls-files`; do echo side B >>$i; done &&
+		for i in $(git ls-files); do echo side B >>$i; done &&
 		git add -u &&
 		echo leaf6 >node2/leaf6 &&
 		git add node2/leaf6 &&
@@ -4759,7 +4759,7 @@ test_setup_12f () {
 		echo g >dir/subdir/tweaked/g &&
 		echo h >dir/subdir/tweaked/h &&
 		test_seq 20 30 >dir/subdir/tweaked/Makefile &&
-		for i in `test_seq 1 88`; do
+		for i in $(test_seq 1 88); do
 			echo content $i >dir/unchanged/file_$i
 		done &&
 		git add . &&
-- 
2.35.1


                 reply	other threads:[~2022-03-13 17:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220313172829.215517-1-gitter.spiros@gmail.com \
    --to=gitter.spiros@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    /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).