From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 03/12] t9130-git-svn-authors-file.sh: use the $( ... ) construct for command substitution Date: Tue, 12 Jan 2016 11:49:29 +0000 Message-ID: <1452599378-47882-4-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:38 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 1aIxT8-00085K-K1 for gcvg-git-2@plane.gmane.org; Tue, 12 Jan 2016 12:50:34 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbcALLu2 (ORCPT ); Tue, 12 Jan 2016 06:50:28 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34362 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753051AbcALLtp (ORCPT ); Tue, 12 Jan 2016 06:49:45 -0500 Received: by mail-wm0-f67.google.com with SMTP id b14so30973559wmb.1 for ; Tue, 12 Jan 2016 03:49:44 -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=0aHHNW+6b0eGFqzre5X6Wwnf2fVfdxzUWN6KvPG/Wi4=; b=xVGzaRwABjv6w3EL/837n4CswbYc91hX7QzRnN83NyhcRWqDC+SPYpEFCfsHzPre0b s5mXKLgS5Ycr8bUOgaCrj6tIlAPobT7wffgiNKfN7W+Ggp+QyLjNBEHveihFrAEBC05R Tiz0vuQ2VhgliwK2UxHqZC3owXTOH13BPbYXNTIPBj2Vg+09zbxH9cN/B1sgYdXXdW+Z 2hpJGiapmiZF+IbdtvidoAGgO8IENpakrU2QUOLeqjRnAJ7D2jqZoAUEfkx1j9374vur SCoAKciD2tJvLVrHtN0XqbzJxiHh84E7mTrdv20tCpir4ymcTR6UTiXbVHU75kyFMBVh 9G4g== X-Received: by 10.28.180.193 with SMTP id d184mr10961929wmf.64.1452599384152; Tue, 12 Jan 2016 03:49:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 03:49:43 -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/t9130-git-svn-authors-file.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh index c44de26..d306b77 100755 --- a/t/t9130-git-svn-authors-file.sh +++ b/t/t9130-git-svn-authors-file.sh @@ -26,7 +26,7 @@ test_expect_success 'start import with incomplete authors file' ' test_expect_success 'imported 2 revisions successfully' ' ( cd x - test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 2 && + test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 2 && git rev-list -1 --pretty=raw refs/remotes/git-svn | \ grep "^author BBBBBBB BBBBBBB " && git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \ @@ -43,7 +43,7 @@ test_expect_success 'continues to import once authors have been added' ' ( cd x git svn fetch --authors-file=../svn-authors && - test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 4 && + test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 4 && git rev-list -1 --pretty=raw refs/remotes/git-svn | \ grep "^author DDDDDDD DDDDDDD " && git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \ @@ -73,8 +73,8 @@ tmp_config_get () { test_expect_success 'failure happened without negative side effects' ' ( cd aa-work && - test 6 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" && - test 6 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`" + test 6 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" && + test 6 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)" ) ' @@ -86,8 +86,8 @@ test_expect_success 'fetch continues after authors-file is fixed' ' ( cd aa-work && git svn fetch --authors-file=../svn-authors && - test 8 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" && - test 8 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`" + test 8 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" && + test 8 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)" ) ' -- 2.5.0