From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 06/10] t/t7602-merge-octopus-many.sh: use the $( ... ) construct for command substitution Date: Fri, 8 Jan 2016 12:06:24 +0100 Message-ID: <1452251188-12939-7-git-send-email-gitter.spiros@gmail.com> References: <1452251188-12939-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Jan 08 12:07:01 2016 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 1aHUsk-000370-Qa for gcvg-git-2@plane.gmane.org; Fri, 08 Jan 2016 12:06:59 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754756AbcAHLGz (ORCPT ); Fri, 8 Jan 2016 06:06:55 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35158 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754660AbcAHLGj (ORCPT ); Fri, 8 Jan 2016 06:06:39 -0500 Received: by mail-pf0-f195.google.com with SMTP id 65so618696pff.2 for ; Fri, 08 Jan 2016 03:06:39 -0800 (PST) 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=1kDlf3VJciQqnffLvzsxaTsZXYzwkgW5/Cqzk1oUTnM=; b=b6sDy6WBpjN2oJUK8cl3XvrP3UIsi3FTUaI1iREz8EY5MbMkHNqlpw6okveempT6Gh f9a8HDIm2W72JbhefBAHsQCaiMVsv9qEVtyJ/3CmK8EiwNg1kYlMWcjaD8Zwo+ux792V Q0h7u7GVaC3NBXhsmiTAuGAYRXf/y8G4maN1IOn/MomkgGBCkqg0rtVNZi/3JJeoQ405 eiyEAGcDwDDb3bnKpX4Wy+qhgGACXKLrjIhNFV7QD04FtbajAJKdhs5nXy6gpBzY89Kv ZcCZliMnNFMI8WAL0drilmOlV1ZtxV7XA5Qabt98N32Zxih4npkYYPWM3FQAfKMGAL2P sdEA== X-Received: by 10.98.64.16 with SMTP id n16mr3427040pfa.16.1452251198843; Fri, 08 Jan 2016 03:06:38 -0800 (PST) Received: from ubuntu14.nephoscale.com (static-67.207.195.141.nephosdns.com. [67.207.195.141]) by smtp.gmail.com with ESMTPSA id fi16sm93143771pac.12.2016.01.08.03.06.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 03:06:38 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1452251188-12939-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 perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}" done and then carefully proof-read. Signed-off-by: Elia Pinto --- t/t7602-merge-octopus-many.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t7602-merge-octopus-many.sh b/t/t7602-merge-octopus-many.sh index 955f09f..6abe441 100755 --- a/t/t7602-merge-octopus-many.sh +++ b/t/t7602-merge-octopus-many.sh @@ -19,7 +19,7 @@ test_expect_success 'setup' ' git add c$i.c && git commit -m c$i && git tag c$i && - i=`expr $i + 1` || return 1 + i=$(expr $i + 1) || return 1 done ' @@ -30,7 +30,7 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' ' while test $i -le 30 do refs="$refs c$i" - i=`expr $i + 1` + i=$(expr $i + 1) done && git merge $refs && test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" && @@ -38,14 +38,14 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' ' while test $i -le 30 do test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" && - i=`expr $i + 1` || return 1 + i=$(expr $i + 1) || return 1 done && git diff --exit-code && i=1 && while test $i -le 30 do test -f c$i.c && - i=`expr $i + 1` || return 1 + i=$(expr $i + 1) || return 1 done ' -- 2.3.3.GIT