{"thread":{"id":"57551","subject":"[PATCH v2] t6423-merge-rename-directories.sh: use the $(...) construct","startedAt":"2022-03-13T17:28:42Z","lastAt":"2022-03-13T17:28:42Z","messageCount":1,"participants":["Elia Pinto"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"451253","messageId":"20220313172829.215517-1-gitter.spiros@gmail.com","threadId":"57551","inReplyTo":null,"subject":"[PATCH v2] t6423-merge-rename-directories.sh: use the $(...) construct","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2022-03-13T17:28:29Z","receivedAt":"2022-03-13T17:28:42Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The Git CodingGuidelines prefer the $(...) construct for command\nsubstitution instead of using the backquotes `...`.\n\nThe backquoted form is the traditional method for command\nsubstitution, and is supported by POSIX.  However, all but the\nsimplest uses become complicated quickly.  In particular, embedded\ncommand substitutions and/or the use of double quotes require\ncareful escaping with the backslash character.\n\nThe patch was generated by:\n\nfor _f in $(find . -name \"*.sh\")\ndo\n\tshellcheck -i SC2006 -f diff ${_f} | ifne git apply -p2\ndone\n\nand then carefully proof-read.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nThis is version 2 of the patch.\n\nIn this one, only the commit message is reformatted\nhttps://lore.kernel.org/all/20220222084646.115147-1-gitter.spiros@gmail.com/t/#md1eb17764414c2a26421b1213ee084912c434d3b\n\n t/t6423-merge-rename-directories.sh | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh\nindex 5b81a130e9..479db32cd6 100755\n--- a/t/t6423-merge-rename-directories.sh\n+++ b/t/t6423-merge-rename-directories.sh\n@@ -4421,14 +4421,14 @@ test_setup_12c1 () {\n \n \t\tgit checkout A &&\n \t\tgit mv node2/ node1/ &&\n-\t\tfor i in `git ls-files`; do echo side A >>$i; done &&\n+\t\tfor i in $(git ls-files); do echo side A >>$i; done &&\n \t\tgit add -u &&\n \t\ttest_tick &&\n \t\tgit commit -m \"A\" &&\n \n \t\tgit checkout B &&\n \t\tgit mv node1/ node2/ &&\n-\t\tfor i in `git ls-files`; do echo side B >>$i; done &&\n+\t\tfor i in $(git ls-files); do echo side B >>$i; done &&\n \t\tgit add -u &&\n \t\ttest_tick &&\n \t\tgit commit -m \"B\"\n@@ -4511,7 +4511,7 @@ test_setup_12c2 () {\n \n \t\tgit checkout A &&\n \t\tgit mv node2/ node1/ &&\n-\t\tfor i in `git ls-files`; do echo side A >>$i; done &&\n+\t\tfor i in $(git ls-files); do echo side A >>$i; done &&\n \t\tgit add -u &&\n \t\techo leaf5 >node1/leaf5 &&\n \t\tgit add node1/leaf5 &&\n@@ -4520,7 +4520,7 @@ test_setup_12c2 () {\n \n \t\tgit checkout B &&\n \t\tgit mv node1/ node2/ &&\n-\t\tfor i in `git ls-files`; do echo side B >>$i; done &&\n+\t\tfor i in $(git ls-files); do echo side B >>$i; done &&\n \t\tgit add -u &&\n \t\techo leaf6 >node2/leaf6 &&\n \t\tgit add node2/leaf6 &&\n@@ -4759,7 +4759,7 @@ test_setup_12f () {\n \t\techo g >dir/subdir/tweaked/g &&\n \t\techo h >dir/subdir/tweaked/h &&\n \t\ttest_seq 20 30 >dir/subdir/tweaked/Makefile &&\n-\t\tfor i in `test_seq 1 88`; do\n+\t\tfor i in $(test_seq 1 88); do\n \t\t\techo content $i >dir/unchanged/file_$i\n \t\tdone &&\n \t\tgit add . &&\n-- \n2.35.1\n\n"}]}