From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 02/10] t/t6001-rev-list-graft.sh: use the $( ... ) construct for command substitution Date: Thu, 7 Jan 2016 14:51:42 +0100 Message-ID: <1452174710-28188-3-git-send-email-gitter.spiros@gmail.com> References: <1452174710-28188-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Thu Jan 07 14:52:09 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 1aHAz1-0001sB-0o for gcvg-git-2@plane.gmane.org; Thu, 07 Jan 2016 14:52:07 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752711AbcAGNwA (ORCPT ); Thu, 7 Jan 2016 08:52:00 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36564 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752293AbcAGNv6 (ORCPT ); Thu, 7 Jan 2016 08:51:58 -0500 Received: by mail-pa0-f54.google.com with SMTP id yy13so166900558pab.3 for ; Thu, 07 Jan 2016 05:51:57 -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=7zF+i0WS9y1KF1yLJ/dRqe65wRcdGEx2hbf8GeI6JUI=; b=WTe/ar4z1MplyK1gqdaBOxM1Hr2P0Gfm627PYNnlMKKJxkne41/PiyP1iQdiytqSoX Gp7bo19jI4eXn7PJcv1NE+wgad/SOxxaM1atd3t5LbrjLEwf91/zlkvppwgcJkI4tIVa PPVJkrvCdLZzpvJ4+baEeh5uPJpEwHowbIGg/Q/LqfLV+GQZNrq34OKQ8ULB9QHWir9t aWI6wJVDzv0SvPzKBL7nxxhi5F2XSTVb/99ho6rOjJNuph1IZi8KzJABptNSfE0MpLih 10cQEPZCX2a1xCRS8r5PUC5KD5auqtG3tsUJtvGztkySpGiH5OnsfiEVAlhMKC3Ddor5 YkJA== X-Received: by 10.66.101.3 with SMTP id fc3mr110154558pab.2.1452174717661; Thu, 07 Jan 2016 05:51:57 -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 kk5sm140627824pab.16.2016.01.07.05.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 05:51:57 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1452174710-28188-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/t6001-rev-list-graft.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t6001-rev-list-graft.sh b/t/t6001-rev-list-graft.sh index 8efcd13..05ddc69 100755 --- a/t/t6001-rev-list-graft.sh +++ b/t/t6001-rev-list-graft.sh @@ -10,15 +10,15 @@ test_expect_success setup ' echo >subdir/fileB fileB && git add fileA subdir/fileB && git commit -a -m "Initial in one history." && - A0=`git rev-parse --verify HEAD` && + A0=$(git rev-parse --verify HEAD) && echo >fileA fileA modified && git commit -a -m "Second in one history." && - A1=`git rev-parse --verify HEAD` && + A1=$(git rev-parse --verify HEAD) && echo >subdir/fileB fileB modified && git commit -a -m "Third in one history." && - A2=`git rev-parse --verify HEAD` && + A2=$(git rev-parse --verify HEAD) && rm -f .git/refs/heads/master .git/index && @@ -26,15 +26,15 @@ test_expect_success setup ' echo >subdir/fileB fileB again && git add fileA subdir/fileB && git commit -a -m "Initial in alternate history." && - B0=`git rev-parse --verify HEAD` && + B0=$(git rev-parse --verify HEAD) && echo >fileA fileA modified in alternate history && git commit -a -m "Second in alternate history." && - B1=`git rev-parse --verify HEAD` && + B1=$(git rev-parse --verify HEAD) && echo >subdir/fileB fileB modified in alternate history && git commit -a -m "Third in alternate history." && - B2=`git rev-parse --verify HEAD` && + B2=$(git rev-parse --verify HEAD) && : done ' -- 2.3.3.GIT