From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 04/10] t9105-git-svn-commit-diff.sh: use the $( ... ) construct for command substitution Date: Tue, 12 Jan 2016 10:45:12 +0000 Message-ID: <1452595518-38149-5-git-send-email-gitter.spiros@gmail.com> References: <1452595518-38149-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Jan 12 11:45:39 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 1aIwSI-0007Xd-Fn for gcvg-git-2@plane.gmane.org; Tue, 12 Jan 2016 11:45:38 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934446AbcALKpd (ORCPT ); Tue, 12 Jan 2016 05:45:33 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35433 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbcALKp2 (ORCPT ); Tue, 12 Jan 2016 05:45:28 -0500 Received: by mail-wm0-f68.google.com with SMTP id f206so30625878wmf.2 for ; Tue, 12 Jan 2016 02:45:27 -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=38SylP3mwKOjxdTquDfSwJjfBbvzGzgnzvGYg36NHlo=; b=Jxgi63RrlTkvxUZ4NZmv+g29Oe+ZyqgAC9lrwEwYNS3MxuzWyqNytLsWeP/lM4MU3l DCVbtQdEpORtBjKmI5Y7BiJCanwajx9hqVdpe2naHlvVztrF+y+inL1dIAxe51DWHnCM Q+m9a0Kf/YYkWLwO0lho+ncH3bRuXghTJ6jw/UsTd5sWpcCS0EU5g/g6F7/2EwNO8EUN zAjjJa5MvjNLlTAhGlhE+ds0Iyyw4OM++TvRz+Y6eh8PWTFNqnOo2/OQZW0ah2cP44sm Ehg1ffqHY5Eu5t4Xtt8vylikgfIVtigEKVxrhtlcI0Lm1jHUdLPpmkByWbmqSY+xOJqN pA/A== X-Received: by 10.28.218.78 with SMTP id r75mr13760774wmg.7.1452595527032; Tue, 12 Jan 2016 02:45:27 -0800 (PST) Received: from ubuntu2pinto.pd5x2phgis1evm2itoce0l41ib.ax.internal.cloudapp.net ([40.113.119.92]) by smtp.gmail.com with ESMTPSA id gb9sm96320537wjb.26.2016.01.12.02.45.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 02:45:26 -0800 (PST) X-Mailer: git-send-email 2.7.0.rc0.20.g4b9ab0e.dirty In-Reply-To: <1452595518-38149-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/t9105-git-svn-commit-diff.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh index 5d0afea..6ed5f74 100755 --- a/t/t9105-git-svn-commit-diff.sh +++ b/t/t9105-git-svn-commit-diff.sh @@ -18,8 +18,8 @@ test_expect_success 'initialize repo' ' git commit -a -m "another" ' -head=`git rev-parse --verify HEAD^0` -prev=`git rev-parse --verify HEAD^1` +head=$(git rev-parse --verify HEAD^0) +prev=$(git rev-parse --verify HEAD^1) # the internals of the commit-diff command are the same as the regular # commit, so only a basic test of functionality is needed since we've -- 2.5.0