From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 09/12] t9300-fast-import.sh: use the $( ... ) construct for command substitution Date: Tue, 12 Jan 2016 11:49:35 +0000 Message-ID: <1452599378-47882-10-git-send-email-gitter.spiros@gmail.com> References: <1452599378-47882-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 12:50:15 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 1aIxSo-0007u2-5B for gcvg-git-2@plane.gmane.org; Tue, 12 Jan 2016 12:50:14 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965006AbcALLuH (ORCPT ); Tue, 12 Jan 2016 06:50:07 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32913 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934878AbcALLtt (ORCPT ); Tue, 12 Jan 2016 06:49:49 -0500 Received: by mail-wm0-f67.google.com with SMTP id u188so30861000wmu.0 for ; Tue, 12 Jan 2016 03:49:48 -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=AyYKRCLznh0JD0N4OeS/yM+dknFZBqkYrid7TLbefqs=; b=UQm3NOHB6ct2WdhLEMg/Qc7bv7htXHycJKwYAH3KyHUVfIuDYWLVow+DObgCaaPtpK vhl9x5EjRBcdQtB7jR52msy5y8fllaXeYo0V/BkUHqiv3hiDXnBPsY6c/GfQdE7ZLkok Q1ogi8kv1N9HJ1/xL7KylWTD8pRGtG2R3HoJZb9NxSGOdfcwtpv2NPk6oPAuHZYDVMU6 SgrukAjdOLKNMJb59HXIIyjfRtKJRE/A3fthudbel7oUbzP9sWbmyJsW/nNPct1LQs9V wdUtwarWdgh9LUEDhbB5d0MA43kBJp0N5Wli+LpFmWHYvWMTE7YDL5Kug/OcfYJMwF7j prBg== X-Received: by 10.194.103.234 with SMTP id fz10mr95925209wjb.31.1452599388368; Tue, 12 Jan 2016 03:49:48 -0800 (PST) Received: from ubuntu2pinto.pd5x2phgis1evm2itoce0l41ib.ax.internal.cloudapp.net ([40.113.119.92]) by smtp.gmail.com with ESMTPSA id k130sm3506702wmg.6.2016.01.12.03.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 03:49:47 -0800 (PST) X-Mailer: git-send-email 2.7.0.rc0.20.g4b9ab0e.dirty In-Reply-To: <1452599378-47882-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/t9300-fast-import.sh | 68 +++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 14a9384..4c5f3c9 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -171,10 +171,10 @@ test_expect_success 'A: verify tag/series-A-blob' ' test_expect_success 'A: verify marks output' ' cat >expect <<-EOF && - :2 `git rev-parse --verify master:file2` - :3 `git rev-parse --verify master:file3` - :4 `git rev-parse --verify master:file4` - :5 `git rev-parse --verify master^0` + :2 $(git rev-parse --verify master:file2) + :3 $(git rev-parse --verify master:file3) + :4 $(git rev-parse --verify master:file4) + :5 $(git rev-parse --verify master^0) EOF test_cmp expect marks.out ' @@ -264,8 +264,8 @@ test_expect_success 'A: verify diff' ' EOF git diff-tree -M -r master verify--import-marks >actual && compare_diff_raw expect actual && - test `git rev-parse --verify master:file2` \ - = `git rev-parse --verify verify--import-marks:copy-of-file2` + test $(git rev-parse --verify master:file2) \ + = $(git rev-parse --verify verify--import-marks:copy-of-file2) ' test_expect_success 'A: export marks with large values' ' @@ -364,7 +364,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' ' git prune" && git fast-import input <<-INPUT_END && commit refs/heads/branch @@ -499,13 +499,13 @@ test_expect_success 'C: verify pack' ' ' test_expect_success 'C: validate reuse existing blob' ' - test $newf = `git rev-parse --verify branch:file2/newf` && - test $oldf = `git rev-parse --verify branch:file2/oldf` + test $newf = $(git rev-parse --verify branch:file2/newf) && + test $oldf = $(git rev-parse --verify branch:file2/oldf) ' test_expect_success 'C: verify commit' ' cat >expect <<-EOF && - parent `git rev-parse --verify master^0` + parent $(git rev-parse --verify master^0) author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE @@ -624,7 +624,7 @@ test_expect_success 'E: verify commit' ' ### test_expect_success 'F: non-fast-forward update skips' ' - old_branch=`git rev-parse --verify branch^0` && + old_branch=$(git rev-parse --verify branch^0) && test_tick && cat >input <<-INPUT_END && commit refs/heads/branch @@ -642,7 +642,7 @@ test_expect_success 'F: non-fast-forward update skips' ' test_must_fail git fast-import expect <<-EOF && - tree `git rev-parse branch~1^{tree}` - parent `git rev-parse branch~1` + tree $(git rev-parse branch~1^{tree}) + parent $(git rev-parse branch~1) author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE @@ -667,7 +667,7 @@ test_expect_success 'F: verify other commit' ' ### test_expect_success 'G: non-fast-forward update forced' ' - old_branch=`git rev-parse --verify branch^0` && + old_branch=$(git rev-parse --verify branch^0) && test_tick && cat >input <<-INPUT_END && commit refs/heads/branch @@ -687,8 +687,8 @@ test_expect_success 'G: verify pack' ' ' test_expect_success 'G: branch changed, but logged' ' - test $old_branch != `git rev-parse --verify branch^0` && - test $old_branch = `git rev-parse --verify branch@{1}` + test $old_branch != $(git rev-parse --verify branch^0) && + test $old_branch = $(git rev-parse --verify branch@{1}) ' ### @@ -763,7 +763,7 @@ test_expect_success 'I: export-pack-edges' ' test_expect_success 'I: verify edge list' ' cat >expect <<-EOF && - .git/objects/pack/pack-.pack: `git rev-parse --verify export-boundary` + .git/objects/pack/pack-.pack: $(git rev-parse --verify export-boundary) EOF sed -e s/pack-.*pack/pack-.pack/ edges.list >actual && test_cmp expect actual @@ -795,8 +795,8 @@ test_expect_success 'J: reset existing branch creates empty commit' ' git fast-import tmp && cat tmp | cut -f 2 >actual && test_cmp expect actual && - git fsck `git rev-parse L2` + git fsck $(git rev-parse L2) ' ### @@ -1106,7 +1106,7 @@ test_expect_success 'N: copy dirty subdirectory' ' INPUT_END git fast-import actual && test_cmp expect actual ' @@ -1631,7 +1631,7 @@ test_expect_success 'P: superproject & submodule mix' ' data <expect <<-EOF && - parent `git rev-parse --verify refs/notes/foobar~2` + parent $(git rev-parse --verify refs/notes/foobar~2) author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE @@ -2045,7 +2045,7 @@ test_expect_success 'Q: verify third note for first commit' ' test_expect_success 'Q: verify fourth notes commit' ' cat >expect <<-EOF && - parent `git rev-parse --verify refs/notes/foobar^` + parent $(git rev-parse --verify refs/notes/foobar^) author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE -- 2.5.0