From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 08/10] t5300-pack-object.sh: use the $( ... ) construct for command substitution Date: Tue, 22 Dec 2015 16:27:51 +0100 Message-ID: <1450798073-22811-9-git-send-email-gitter.spiros@gmail.com> References: <1450798073-22811-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Dec 22 16:28:46 2015 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 1aBOrk-0002oI-HS for gcvg-git-2@plane.gmane.org; Tue, 22 Dec 2015 16:28:44 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755215AbbLVP2T (ORCPT ); Tue, 22 Dec 2015 10:28:19 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:34372 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755210AbbLVP2G (ORCPT ); Tue, 22 Dec 2015 10:28:06 -0500 Received: by mail-pf0-f172.google.com with SMTP id u7so61509676pfb.1 for ; Tue, 22 Dec 2015 07:28:06 -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=Q59FgEbRSaoebLCQNftFYel4M7ekKt4Q0jzwsmmLRbU=; b=igh0+JxqBr3NWBY7I2rV/NyKYPt+7AyUoVsNosYgYmkQEpJWRtQLUO5Io4z+fGo/hd W3+izXjWQBhyHROjtYjF2D2nsx9Rwi29VNZjNuU8LVdDFZDu9V354yHij/yiZHTalHzT weqtf8OHNws3pRUncgmGYyJijrjBE4UZ7AVkM62acJGWAnOdvCl5sXkPQbyD99EiqOjA CDXpeNHfI9eHx5fy1m0DAsNMn1XhLz3/Org0y6ASx2pqgLGX2HT4fMhkzkLcxqrgTW7W ernngEF7KUPX16jWgDD7wOHazWttqCasU8Tsq1jB8AjusStgidl236Ndq3gs0zk/mxV8 psrw== X-Received: by 10.98.75.197 with SMTP id d66mr36477362pfj.137.1450798085855; Tue, 22 Dec 2015 07:28:05 -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 q190sm42030149pfq.59.2015.12.22.07.28.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 07:28:05 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1450798073-22811-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/t5300-pack-object.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 20c1961..fc2be63 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -8,7 +8,7 @@ test_description='git pack-object ' . ./test-lib.sh -TRASH=`pwd` +TRASH=$(pwd) test_expect_success \ 'setup' \ @@ -20,8 +20,8 @@ test_expect_success \ test-genrandom "seed b" 2097152 > b_big && git update-index --add a a_big b b_big c && cat c >d && echo foo >>d && git update-index --add d && - tree=`git write-tree` && - commit=`git commit-tree $tree expect' @@ -147,7 +147,7 @@ test_expect_success \ git diff-tree --root -p $commit && while read object do - t=`git cat-file -t $object` && + t=$(git cat-file -t $object) && git cat-file $t $object || return 1 done current && @@ -162,7 +162,7 @@ test_expect_success \ git diff-tree --root -p $commit && while read object do - t=`git cat-file -t $object` && + t=$(git cat-file -t $object) && git cat-file $t $object || return 1 done current && @@ -177,7 +177,7 @@ test_expect_success \ git diff-tree --root -p $commit && while read object do - t=`git cat-file -t $object` && + t=$(git cat-file -t $object) && git cat-file $t $object || return 1 done current && @@ -252,8 +252,8 @@ test_expect_success \ test_expect_success \ 'verify-pack catches a corrupted sum of the index file itself' \ - 'l=`wc -c test-3.pack && printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l && if git verify-pack test-3.pack -- 2.3.3.GIT