From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 02/10] t3210-pack-refs.sh: use the $( ... ) construct for command substitution Date: Tue, 22 Dec 2015 16:27:45 +0100 Message-ID: <1450798073-22811-3-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:11 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 1aBOr9-0001p6-RJ for gcvg-git-2@plane.gmane.org; Tue, 22 Dec 2015 16:28:08 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932095AbbLVP2D (ORCPT ); Tue, 22 Dec 2015 10:28:03 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35970 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754498AbbLVP2B (ORCPT ); Tue, 22 Dec 2015 10:28:01 -0500 Received: by mail-pa0-f46.google.com with SMTP id q3so98113137pav.3 for ; Tue, 22 Dec 2015 07:28:00 -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=uL+EvSwrWW92sqjGcF8B5ik5dTTzlK9jTAAi0NkInfI=; b=gqYt5aqGz50sIpHPc9eVfiNDoVv5xLtpxjyBib4OyV/3xRA8JS5bLUGAo7k/fqFw7C tjkipz28u+PM5MwZCs0oyE5YpGB4ResujLSbj0coyopxy0lIRimdXUfp3cniwCbIvClo 5go0BCIHfSLNOvAQnUEGW6/N30gEZI5Yfb4xCKbv1E/a1wzEHT7Y//6G6lJpFr5deMMH 8TA3mt7u0mdY2ucuSCN48rYCasncgNGePdS56zdPhxpAdV4xuHEqeMnYedl6Qp1iWtpm jAPWmW9zQVWtloczljW2Cl4JQ5FPbJltstAEnV1hf3qlcIvRKKqCne1YENMhDJ8rFQBa ZiZQ== X-Received: by 10.66.65.203 with SMTP id z11mr36554818pas.152.1450798080488; Tue, 22 Dec 2015 07:28:00 -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.27.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 07:27:59 -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/t3210-pack-refs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index db244d2..9b182a0 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -27,7 +27,7 @@ SHA1= test_expect_success \ 'see if git show-ref works as expected' \ 'git branch a && - SHA1=`cat .git/refs/heads/a` && + SHA1=$(cat .git/refs/heads/a) && echo "$SHA1 refs/heads/a" >expect && git show-ref a >result && test_cmp expect result' -- 2.3.3.GIT