From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 10/14] t1002-read-tree-m-u-2way.sh: use the $( ... ) construct for command substitution Date: Mon, 28 Apr 2014 05:57:33 -0700 Message-ID: <1398689857-17014-10-git-send-email-gitter.spiros@gmail.com> References: <1398689857-17014-1-git-send-email-gitter.spiros@gmail.com> Cc: matthieu.moy@grenoble-inp.fr, Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Apr 28 14:58:07 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wel8G-0003pg-E4 for gcvg-git-2@plane.gmane.org; Mon, 28 Apr 2014 14:58:04 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755796AbaD1M55 (ORCPT ); Mon, 28 Apr 2014 08:57:57 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:60065 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755764AbaD1M5w (ORCPT ); Mon, 28 Apr 2014 08:57:52 -0400 Received: by mail-pb0-f42.google.com with SMTP id un15so5827044pbc.15 for ; Mon, 28 Apr 2014 05:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=phdvZ5ai0+xviRHYebb0rz85RfW59JXHNPP3Ool5cZ4=; b=WbIoFViqXSKkrh6LaODfdKUHAKoP0zbf2QaEU0VaeD9K+Ta8TI7la4Lb9HE7m6Q08u mpnbteIWRrbXmTcFyWgutfw90TvP02NhfR1wV+aX5WDtoLwXRXU+rYI9toFIXG05KZJg OnoeHL26CZnbNNEja9zfwc6zwgXKGgJ6QMkkxS1s5jSX+6tqpv7kaZJAMMjtLh0+Vq1S /tX3bq+uIpd035wpqbLXP+1KCQ4mlmL236eSFW3CkGMZQbExe73djtgavcsWga/CcAvd o/SYqh0kNAAL6MBeictiZE6+uD86WB2AvGkN8VjKUxT94peyDei0DR6R/lwm5+cHHliz vlAA== X-Received: by 10.68.129.34 with SMTP id nt2mr29049863pbb.18.1398689872139; Mon, 28 Apr 2014 05:57:52 -0700 (PDT) Received: from devzero2000ubu.nephoscale.com (140.195.207.67.nephoscale.net. [67.207.195.140]) by mx.google.com with ESMTPSA id ky8sm34896290pbc.64.2014.04.28.05.57.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 05:57:51 -0700 (PDT) X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398689857-17014-1-git-send-email-gitter.spiros@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto --- t/t1002-read-tree-m-u-2way.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh index a847709..fed877b 100755 --- a/t/t1002-read-tree-m-u-2way.sh +++ b/t/t1002-read-tree-m-u-2way.sh @@ -21,7 +21,7 @@ compare_change () { } check_cache_at () { - clean_if_empty=`git diff-files -- "$1"` + clean_if_empty=$(git diff-files -- "$1") case "$clean_if_empty" in '') echo "$1: clean" ;; ?*) echo "$1: dirty" ;; @@ -41,14 +41,14 @@ test_expect_success \ echo bozbar >bozbar && echo rezrov >rezrov && git update-index --add nitfol bozbar rezrov && - treeH=`git write-tree` && + treeH=$(git write-tree) && echo treeH $treeH && git ls-tree $treeH && echo gnusto >bozbar && git update-index --add frotz bozbar --force-remove rezrov && git ls-files --stage >M.out && - treeM=`git write-tree` && + treeM=$(git write-tree) && echo treeM $treeM && git ls-tree $treeM && sum bozbar frotz nitfol >M.sum && @@ -318,7 +318,7 @@ test_expect_success \ 'rm -f .git/index && echo DF >DF && git update-index --add DF && - treeDF=`git write-tree` && + treeDF=$(git write-tree) && echo treeDF $treeDF && git ls-tree $treeDF && @@ -326,7 +326,7 @@ test_expect_success \ mkdir DF && echo DF/DF >DF/DF && git update-index --add --remove DF DF/DF && - treeDFDF=`git write-tree` && + treeDFDF=$(git write-tree) && echo treeDFDF $treeDFDF && git ls-tree $treeDFDF && git ls-files --stage >DFDF.out' -- 1.7.10.4