From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 06/10] t9108-git-svn-glob.sh: use the $( ... ) construct for command substitution Date: Tue, 12 Jan 2016 10:45:14 +0000 Message-ID: <1452595518-38149-7-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:46:23 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 1aIwSz-0007xN-QM for gcvg-git-2@plane.gmane.org; Tue, 12 Jan 2016 11:46:22 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934852AbcALKpn (ORCPT ); Tue, 12 Jan 2016 05:45:43 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33763 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934391AbcALKp3 (ORCPT ); Tue, 12 Jan 2016 05:45:29 -0500 Received: by mail-wm0-f68.google.com with SMTP id u188so30567744wmu.0 for ; Tue, 12 Jan 2016 02:45:28 -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=h1DpOIVcp8R1BRKneg78U1MVqJSy84C5MS637LdmuDM=; b=MBq8seEyliUKICRPFhnFdjyBAECL5PFDpgLcR1m9hR0LkwFqoTxoI5QVz+PD3dvl2O YlhwTmmv3jAXZ8gOutjBu0om9TijPBNqA+trpvo5iDtRAffFi+vtksH0mZf9x9lM1AJX MVIJtOrjixIp0PeMyPx/a8X/mq4sBCBEV4tZrFD6z3wDDgkaN3diYcZ/9bu/vouu8wfO 345kXVnS/dQU/Quj6IE4U08zsvmt1R6G0u9dsPnxVg0Md+iGfp4Zc/OnIPEu9nobuSWP LBidL/afYROIdCUN0ZXRJ3BfHQlAN9mNtMSpQ3U+aCUEy+ErO1uRCkvjo42WCqakupKr 5PzA== X-Received: by 10.194.87.1 with SMTP id t1mr101685504wjz.170.1452595528364; Tue, 12 Jan 2016 02:45:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 02:45:27 -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/t9108-git-svn-glob.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh index d732d31..a526d60 100755 --- a/t/t9108-git-svn-glob.sh +++ b/t/t9108-git-svn-glob.sh @@ -50,10 +50,10 @@ test_expect_success 'test refspec globbing' ' git log --pretty=oneline refs/remotes/tags/end | \ sed -e "s/^.\{41\}//" > output.end && test_cmp expect.end output.end && - test "`git rev-parse refs/remotes/tags/end~1`" = \ - "`git rev-parse refs/remotes/branches/start`" && - test "`git rev-parse refs/remotes/branches/start~2`" = \ - "`git rev-parse refs/remotes/trunk`" && + test "$(git rev-parse refs/remotes/tags/end~1)" = \ + "$(git rev-parse refs/remotes/branches/start)" && + test "$(git rev-parse refs/remotes/branches/start~2)" = \ + "$(git rev-parse refs/remotes/trunk)" && test_must_fail git rev-parse refs/remotes/tags/end@3 ' @@ -75,12 +75,12 @@ test_expect_success 'test left-hand-side only globbing' ' svn_cmd commit -m "try to try" ) && git svn fetch two && - test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 && - test `git rev-list refs/remotes/two/branches/start | wc -l` -eq 3 && - test `git rev-parse refs/remotes/two/branches/start~2` = \ - `git rev-parse refs/remotes/two/trunk` && - test `git rev-parse refs/remotes/two/tags/end~3` = \ - `git rev-parse refs/remotes/two/branches/start` && + test $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 && + test $(git rev-list refs/remotes/two/branches/start | wc -l) -eq 3 && + test $(git rev-parse refs/remotes/two/branches/start~2) = \ + $(git rev-parse refs/remotes/two/trunk) && + test $(git rev-parse refs/remotes/two/tags/end~3) = \ + $(git rev-parse refs/remotes/two/branches/start) && git log --pretty=oneline refs/remotes/two/tags/end | \ sed -e "s/^.\{41\}//" > output.two && test_cmp expect.two output.two -- 2.5.0