From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Date: Mon, 28 Apr 2014 05:57:24 -0700 Message-ID: <1398689857-17014-1-git-send-email-gitter.spiros@gmail.com> Cc: matthieu.moy@grenoble-inp.fr, Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Apr 28 14:57:56 2014 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 1Wel87-0003e5-OF for gcvg-git-2@plane.gmane.org; Mon, 28 Apr 2014 14:57:56 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755572AbaD1M5o (ORCPT ); Mon, 28 Apr 2014 08:57:44 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:64090 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752197AbaD1M5m (ORCPT ); Mon, 28 Apr 2014 08:57:42 -0400 Received: by mail-pd0-f179.google.com with SMTP id y10so738313pdj.24 for ; Mon, 28 Apr 2014 05:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=inlS7NbN2KdA+J4XkT1jRAkrH9iKB5iuvEzRskOCLag=; b=TcW6BexUzwqwxSG5kRE6bGfyW+i7V4a4ygbKCazo1oaRCwlK7pjJlMaIfJnJWhn5d6 6/oefrTudA3L84qQcQ3puC2FWinkDID7aeR6JFL+dXqNaQWumCP4DJi/PMdH2sAju7Mp ydH6kCdQ1/1QmmALJiXRHR6bgPkXogGUlxJcpbRFx+K91QjQiyEYbqq0SsOG7HqAg1Je 9HAGhIyj4AdjS3Jf9jEbi6JCKkDAmpz7+rWXz1ltxzJD1jbiWRblHHR685G/jwM4e6nb Yepwc9wb7mnbdrrzcZC+8cDiGS3C00nBtjY/cRnAtsTNhvrg8CNHvED1rG1/Ci4Wo++t U8Zw== X-Received: by 10.69.17.230 with SMTP id gh6mr29026922pbd.0.1398689861870; Mon, 28 Apr 2014 05:57:41 -0700 (PDT) Received: from devzero2000ubu.nephoscale.com (140.195.207.67.nephoscale.net. [67.207.195.140]) by mx.google.com with ESMTPSA id ky8sm34896290pbc.64.2014.04.28.05.57.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 05:57:40 -0700 (PDT) X-Mailer: git-send-email 1.7.10.4 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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto --- t/t0001-init.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t0001-init.sh b/t/t0001-init.sh index bbc9cb6..2f30203 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -185,14 +185,14 @@ test_expect_success 'init --bare/--shared overrides system/global config' ' git init --bare --shared=0666 init-bare-shared-override && check_config init-bare-shared-override true unset && test x0666 = \ - x`git config -f init-bare-shared-override/config core.sharedRepository` + x$(git config -f init-bare-shared-override/config core.sharedRepository) ' test_expect_success 'init honors global core.sharedRepository' ' test_config_global core.sharedRepository 0666 && git init shared-honor-global && test x0666 = \ - x`git config -f shared-honor-global/.git/config core.sharedRepository` + x$(git config -f shared-honor-global/.git/config core.sharedRepository) ' test_expect_success 'init rejects insanely long --template' ' @@ -285,7 +285,7 @@ test_expect_success 'init prefers command line to GIT_DIR' ' test_expect_success 'init with separate gitdir' ' rm -rf newdir && git init --separate-git-dir realgitdir newdir && - echo "gitdir: `pwd`/realgitdir" >expected && + echo "gitdir: $(pwd)/realgitdir" >expected && test_cmp expected newdir/.git && test_path_is_dir realgitdir/refs ' @@ -299,7 +299,7 @@ test_expect_success 're-init to update git link' ' cd newdir && git init --separate-git-dir ../surrealgitdir ) && - echo "gitdir: `pwd`/surrealgitdir" >expected && + echo "gitdir: $(pwd)/surrealgitdir" >expected && test_cmp expected newdir/.git && test_path_is_dir surrealgitdir/refs && test_path_is_missing realgitdir/refs @@ -312,7 +312,7 @@ test_expect_success 're-init to move gitdir' ' cd newdir && git init --separate-git-dir ../realgitdir ) && - echo "gitdir: `pwd`/realgitdir" >expected && + echo "gitdir: $(pwd)/realgitdir" >expected && test_cmp expected newdir/.git && test_path_is_dir realgitdir/refs ' @@ -326,7 +326,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' ' ln -s here .git && git init --separate-git-dir ../realgitdir ) && - echo "gitdir: `pwd`/realgitdir" >expected && + echo "gitdir: $(pwd)/realgitdir" >expected && test_cmp expected newdir/.git && test_cmp expected newdir/here && test_path_is_dir realgitdir/refs -- 1.7.10.4