From patchwork Tue Feb 22 08:46:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elia Pinto X-Patchwork-Id: 12754658 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 DBE1BC433F5 for ; Tue, 22 Feb 2022 08:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbiBVIr4 (ORCPT ); Tue, 22 Feb 2022 03:47:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiBVIrw (ORCPT ); Tue, 22 Feb 2022 03:47:52 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C40396825 for ; Tue, 22 Feb 2022 00:47:26 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id v12so31677304wrv.2 for ; Tue, 22 Feb 2022 00:47:25 -0800 (PST) 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=ioNY8222E/XTPcQqZg7n1UdXxL0yVndmku8l0Oudyv8=; b=XwSmjE1eflBGpHy2ZQL02xmC91nDRu4by8lhz5i7pc5CLsGT7lwWj6A3E93V6ZKXzc sY+mZcyMHvbtVhoZ6BXBK4mjf1irvL7yNNYKxUsPpt2HBh88np1iw9iU0RH0jZLJjI6b rF9J63clxu/7LGGyqGBJGM1uKwwpmN3NIicWbtbBC3/SmUBcPPv2QkVMtVVJwtKeLZyF RiLTQmw5RUrAlrXfK+kmWL689MfhzxE3HGXJSmOso5O/94KsV6nwmwH1jjmyf3ZAKSoK 1ato90KaUFwGilc2yLlVrTWpG3xyY13g+Ksd2SMC2UX9242EDL/SsDxNR92sJS5Y33kj 8Kgw== 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=ioNY8222E/XTPcQqZg7n1UdXxL0yVndmku8l0Oudyv8=; b=MQI8pJP2yOH7lLHTB+661GIKS0W34WiQIxhCm102XBbomC8Cd48zobTqYTLU3CYeWb 7LWvYFgAjDA8h921wAOD4NCpBFYCKFIgtQe0GQSg+s3WAFaPNLmKPG5DXuMiQfYyCXpP IrfsgxpLDx4SC4kRndb7E9MLkT1l42bwxbfqn7MLq/s6Xm4KtRc+tx5d/pPzV1BaGt2R ifJv/OnyFWgFYE8K/PYeyk2ArmKv8rHzELxIiAzR04a2nJD+XgUkV+2nk6CwhP5UnqJi kzOBDcKHQyRx5+vBr8WpYMHrxgrWvrZdjYgngLrtUqRTeg7QbGf8KUWlp5JrcVa8h4oP /lzA== X-Gm-Message-State: AOAM5329nLq3tTbnKMzXst2snqkpfTQceM59yp42siADuXxxgnEVTOqa 31ld9Z5SAWD9K1HD1AjBbZYKVFQDOkw= X-Google-Smtp-Source: ABdhPJyLpFLXq9Qfqi0WHh2j3AY9aYlzd0+c0GlnQEAl37uDa15Uomr6hFhBDda6xrWpEmqmpKXaYQ== X-Received: by 2002:a5d:6d4e:0:b0:1e3:3636:b104 with SMTP id k14-20020a5d6d4e000000b001e33636b104mr19347491wri.605.1645519644120; Tue, 22 Feb 2022 00:47:24 -0800 (PST) Received: from fedora35.example.com ([151.24.56.251]) by smtp.gmail.com with ESMTPSA id f18sm2010636wmg.21.2022.02.22.00.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 00:47:23 -0800 (PST) From: Elia Pinto To: git@vger.kernel.org Cc: Elia Pinto Subject: [PATCH] t6423-merge-rename-directories.sh: use the $(...) construct for command substitution Date: Tue, 22 Feb 2022 08:46:46 +0000 Message-Id: <20220222084646.115147-1-gitter.spiros@gmail.com> X-Mailer: git-send-email 2.32.0 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 --- 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 . &&