From patchwork Sun Mar 13 17:28:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elia Pinto X-Patchwork-Id: 12779419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81FE9C433EF for ; Sun, 13 Mar 2022 17:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235149AbiCMR3t (ORCPT ); Sun, 13 Mar 2022 13:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235171AbiCMR3p (ORCPT ); Sun, 13 Mar 2022 13:29:45 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B818403F2 for ; Sun, 13 Mar 2022 10:28:37 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id qt6so29246083ejb.11 for ; Sun, 13 Mar 2022 10:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5e0mBP4WULZxN0r9zeb/Mg45hmzjsm+oSjPP+g65J8c=; b=MWHJBMmzxrNgrlPLTgR57xOpUtlaWFfEQwCvFZULL6fW0yfL46hxffASH5bMH42nZh cqQejAF88XrgikRwklONNy+4hrt+YV/APUQt4CFfl8ckC5aplBKyALnnj47A2qFc31GX /OmNQ82OYv+b/HV0fHdmdXF8MxBm4PWQsPlUvojw8TLPQgfi3L7paQlwxVgRyrgxi1Qp qBWOF7yBxZneVMTJ8SedoMg48KFFM+2aUnNG/pnrwF72Vvl+pjLOoM/nd/YGcNjBI8Xy lUpOlTS+nce9zeN0eTw5AXkHJoyO74Tr31NvqOHo+OrSolU5PcP+J3NN1ujdDDmQGuQN GeMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5e0mBP4WULZxN0r9zeb/Mg45hmzjsm+oSjPP+g65J8c=; b=SyYIHfJOCsF7q1LJFTfRvNfTjcF3PIrhgzwOAJVZKZl8K1Kkvq/5lFPOBTc6HbJ4Pd vsH/SDCbmmA9BX4UE1Hp6vWk97+vRqCg8Tb/nRalKcyMOcFU3rcJp1iCRu/Sp0/Ja82C bUzulOc2OBvHKEtiZ39PpSbe9mEu1t4XzoFGtNBojjocsnml6B5Tv/vhxe6wMAuC2rtw GDSRJ/kCxYk6/NJb5lVsabnzaZDk0o35gNIQbTJCJ+BV/ENDJAZXTfQaMhWX+jAa2r5G A2IOgRhR9jkETzlFAKwxzjd6Ye8MmgEasSJLNbQwHAgkdHuuCGPN9k4hLGrGMWtNQgpq teHA== X-Gm-Message-State: AOAM5312oEnetESHX5KZ22fOX1jtdYKGC3LMq7c6awGu6VwUukVKzXQH ZlDzguvwJ//PZ543TtCf89/E6tGaKiM= X-Google-Smtp-Source: ABdhPJxpOE6gkvMYga97op26JsRZ+2tEb796JvrygR0e4wId7gTjkc8z49Wb4555WNJgj8kx7E0G5g== X-Received: by 2002:a17:906:1955:b0:6da:b4a3:7818 with SMTP id b21-20020a170906195500b006dab4a37818mr15961662eje.384.1647192515381; Sun, 13 Mar 2022 10:28:35 -0700 (PDT) Received: from fedora35.example.com ([151.27.250.86]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm5673552ejj.74.2022.03.13.10.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 10:28:34 -0700 (PDT) From: Elia Pinto To: git@vger.kernel.org Cc: derrickstolee@github.com, Elia Pinto Subject: [PATCH v2] t6423-merge-rename-directories.sh: use the $(...) construct Date: Sun, 13 Mar 2022 17:28:29 +0000 Message-Id: <20220313172829.215517-1-gitter.spiros@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 --- 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 . &&