From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 03/10] t/t1410-reflog.sh: use the $( ... ) construct for command substitution Date: Tue, 22 Dec 2015 16:05:48 +0100 Message-ID: <1450796755-15848-4-git-send-email-gitter.spiros@gmail.com> References: <1450796755-15848-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:06:44 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 1aBOWQ-0004x6-Er for gcvg-git-2@plane.gmane.org; Tue, 22 Dec 2015 16:06:43 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932973AbbLVPGi (ORCPT ); Tue, 22 Dec 2015 10:06:38 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35284 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932365AbbLVPGC (ORCPT ); Tue, 22 Dec 2015 10:06:02 -0500 Received: by mail-pa0-f43.google.com with SMTP id jx14so90778158pad.2 for ; Tue, 22 Dec 2015 07:06:01 -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=DCKu2eUg5yr+taPW3SQQ3EhsVRY2YAGUWIgI5t5svNI=; b=XfN5D8rDeBi6fm+Kx7UkCYFkBy664mxlQZUeJ44qZwNK7/hnDGTe1iXzk2I3yIlQs+ rRL+iq8jGvYxolI3LolC6oKqSlglehyTZ1zYObI6BTGe9KniCX+nb7pHzYZ6E1hXOpCK 84Lgjk84cvCu+qbonMqK3EltGsiiEi0QaZv9J14TqewNhjGjKxqc8tuggEZrgs18pkAw pVYRFZq1povK80Br9nhyVrhFFLsP/P9JU/bmWoRvS6Qaq3OC9apDCftkX1bhP1zScJYt iKL/momWvw1Ft7WPi5cxSOke3pcdzlZsEr+EMsheI28pHxsoh8+ZJFb35ckwCktXyFR7 jkEg== X-Received: by 10.66.254.100 with SMTP id ah4mr23868348pad.121.1450796761685; Tue, 22 Dec 2015 07:06:01 -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 hz8sm46766591pac.10.2015.12.22.07.06.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 07:06:01 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1450796755-15848-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/t1410-reflog.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index b79049f..fbed8d7 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -62,18 +62,18 @@ test_expect_success setup ' git add . && test_tick && git commit -m rabbit && - H=`git rev-parse --verify HEAD` && - A=`git rev-parse --verify HEAD:A` && - B=`git rev-parse --verify HEAD:A/B` && - C=`git rev-parse --verify HEAD:C` && - D=`git rev-parse --verify HEAD:A/D` && - E=`git rev-parse --verify HEAD:A/B/E` && + H=$(git rev-parse --verify HEAD) && + A=$(git rev-parse --verify HEAD:A) && + B=$(git rev-parse --verify HEAD:A/B) && + C=$(git rev-parse --verify HEAD:C) && + D=$(git rev-parse --verify HEAD:A/D) && + E=$(git rev-parse --verify HEAD:A/B/E) && check_fsck && test_chmod +x C && git add C && test_tick && git commit -m dragon && - L=`git rev-parse --verify HEAD` && + L=$(git rev-parse --verify HEAD) && check_fsck && rm -f C A/B/E && @@ -81,15 +81,15 @@ test_expect_success setup ' echo horse >A/G && git add F A/G && test_tick && git commit -a -m sheep && - F=`git rev-parse --verify HEAD:F` && - G=`git rev-parse --verify HEAD:A/G` && - I=`git rev-parse --verify HEAD:A` && - J=`git rev-parse --verify HEAD` && + F=$(git rev-parse --verify HEAD:F) && + G=$(git rev-parse --verify HEAD:A/G) && + I=$(git rev-parse --verify HEAD:A) && + J=$(git rev-parse --verify HEAD) && check_fsck && rm -f A/G && test_tick && git commit -a -m monkey && - K=`git rev-parse --verify HEAD` && + K=$(git rev-parse --verify HEAD) && check_fsck && check_have A B C D E F G H I J K L && -- 2.3.3.GIT