From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 04/10] t/t1511-rev-parse-caret.sh: use the $( ... ) construct for command substitution Date: Tue, 22 Dec 2015 16:05:49 +0100 Message-ID: <1450796755-15848-5-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:36 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 1aBOWI-0004nC-HA for gcvg-git-2@plane.gmane.org; Tue, 22 Dec 2015 16:06:34 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932975AbbLVPGb (ORCPT ); Tue, 22 Dec 2015 10:06:31 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34051 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932491AbbLVPGD (ORCPT ); Tue, 22 Dec 2015 10:06:03 -0500 Received: by mail-pa0-f45.google.com with SMTP id uo6so13613940pac.1 for ; Tue, 22 Dec 2015 07:06:02 -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=5nUZ06r3FQcdEVi/z3VxUglGSoA6JNXkHFpT36O2STM=; b=Ldxx2HO0qc0gA4m9n+aa3J/bCzHq9qst2Xda3fm0WGNlx0WNf2hy8U/hQ6CSc6/Njc ROAl+Xym/msaD8OOSjmhas8GkHPC8VihDj0nIKjZiRWRvKs64H/T3Vk22eRpFAHGQzR2 P3vjgX86qTlLsqemtxQWht10qRljBWUgxTH3u1V8wDFCabEkHDJXHgcqmEPB1RFeVImx DpQemuS6/NVF293KMlFoVV3ecPXk6NOIVPywHdn2XrZQGoraKkLB6lYLleVp1zyY3Wo0 +NOM+zywd+BbVf7WeMpywRSjgRzNyx7QzrmNfhgCIQnV768vCx0hPjAAUXSS341uX0Ch Wt0A== X-Received: by 10.66.190.66 with SMTP id go2mr36901638pac.114.1450796762753; Tue, 22 Dec 2015 07:06:02 -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.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 07:06:02 -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/t1511-rev-parse-caret.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh index 15973f2..7043ba7 100755 --- a/t/t1511-rev-parse-caret.sh +++ b/t/t1511-rev-parse-caret.sh @@ -6,11 +6,11 @@ test_description='tests for ref^{stuff}' test_expect_success 'setup' ' echo blob >a-blob && - git tag -a -m blob blob-tag `git hash-object -w a-blob` && + git tag -a -m blob blob-tag $(git hash-object -w a-blob) && mkdir a-tree && echo moreblobs >a-tree/another-blob && git add . && - TREE_SHA1=`git write-tree` && + TREE_SHA1=$(git write-tree) && git tag -a -m tree tree-tag "$TREE_SHA1" && git commit -m Initial && git tag -a -m commit commit-tag && -- 2.3.3.GIT