From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 01/10] t9100-git-svn-basic.sh: use the $( ... ) construct for command substitution Date: Tue, 12 Jan 2016 10:45:09 +0000 Message-ID: <1452595518-38149-2-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:36 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 1aIwSE-0007W4-QM for gcvg-git-2@plane.gmane.org; Tue, 12 Jan 2016 11:45:35 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934387AbcALKp2 (ORCPT ); Tue, 12 Jan 2016 05:45:28 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34757 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753811AbcALKpZ (ORCPT ); Tue, 12 Jan 2016 05:45:25 -0500 Received: by mail-wm0-f67.google.com with SMTP id b14so30678998wmb.1 for ; Tue, 12 Jan 2016 02:45:25 -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=W+O77HHkPkIDuI/DxCjd1EeDsRD5TIQzRh+vTkmsMIE=; b=Sn+306CmT3u4fMgOXL7I0Vthx5bnY64MJLKNk+C9vdsCDjnUg5slz2uEyNpzJG1vd+ 8bvuZfGqe7uQDb7hpMpmhnILi42E7rKphPRt5k5MgRJin5sQL6hjDjejWv0fHtX5zlyu RvbPBpM21kr9aWnwOMgWRMoAQBz0Ny5NWHcC4FxL7ozkytorC2zbylYYf3JO+7kN8Kwh QcdcsxV+ZSB6r4jhRNtKCqXX/7D4i8e6dZDqnLCDG/W8kjPuk8/Qlblgi67aWEH1ftGF UGl7s4uZvQ0UNV58Xy/7q5p1iczO5qvv5Tq2wy72+aLMzeG5mu47UdpBTz/TcaQlFmSl P5EA== X-Received: by 10.194.172.35 with SMTP id az3mr159473714wjc.64.1452595524871; Tue, 12 Jan 2016 02:45:24 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 02:45:24 -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/t9100-git-svn-basic.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index 4fea8d9..258d9b8 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -265,18 +265,18 @@ test_expect_success 'able to dcommit to a subdirectory' " git update-index --add d && git commit -m '/bar/d should be in the log' && git svn dcommit -i bar && - test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" && + test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\" && mkdir newdir && echo new > newdir/dir && git update-index --add newdir/dir && git commit -m 'add a new directory' && git svn dcommit -i bar && - test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" && + test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\" && echo foo >> newdir/dir && git update-index newdir/dir && git commit -m 'modify a file in new directory' && git svn dcommit -i bar && - test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" + test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\" " test_expect_success 'dcommit should not fail with a touched file' ' @@ -295,7 +295,7 @@ test_expect_success 'able to set-tree to a subdirectory' " git update-index d && git commit -m 'update /bar/d' && git svn set-tree -i bar HEAD && - test -z \"\`git diff refs/heads/my-bar refs/remotes/bar\`\" + test -z \"\$(git diff refs/heads/my-bar refs/remotes/bar)\" " test_expect_success 'git-svn works in a bare repository' ' -- 2.5.0