From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 11/12] t9501-gitweb-standalone-http-status.sh: use the $( ... ) construct for command substitution Date: Tue, 12 Jan 2016 11:49:37 +0000 Message-ID: <1452599378-47882-12-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:04 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 1aIxSc-0007nM-VK for gcvg-git-2@plane.gmane.org; Tue, 12 Jan 2016 12:50:03 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964963AbcALLtz (ORCPT ); Tue, 12 Jan 2016 06:49:55 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32921 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964819AbcALLtu (ORCPT ); Tue, 12 Jan 2016 06:49:50 -0500 Received: by mail-wm0-f67.google.com with SMTP id u188so30861058wmu.0 for ; Tue, 12 Jan 2016 03:49:50 -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=yF7+CKcRdZuUX0thL+mbw7XZasSZGS78XDOFtPv3sjc=; b=PFbn4SdPNDkFoShOei+cSn1HB7XZ1V2Y1fgUzGpVsSdfv4TFhaSCfFtxwq2m+96pBg zsnOpiBhzCo3EfXKvhFOiNWdWYmJQdCOgXzVYBXSgEHfi2qUm3e1XgWzOyzLYoFr8LfS f25UOWd9E/FqC0FatNKWwRVQu+hhr+XKzb1o3JqPQepgkK74etw/8rxdl6iRtAPKoGTR xOwoQ3aOrvzWhMvc6OgFU7YtZRGJmkpl/OS9TmaAmqsyhrq52WfuIbAd04Ui0M0YgNvB KPvaNCGO8AUgt53NY+d1hDnn87Sx75TYLbFyJKRVNPKfhL+nMTNvexVUBL8WURIkTl8h MUgg== X-Received: by 10.28.111.18 with SMTP id k18mr18077275wmc.86.1452599389723; Tue, 12 Jan 2016 03:49:49 -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.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 03:49:49 -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/t9501-gitweb-standalone-http-status.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh index d3a5bac..2a0ffed 100755 --- a/t/t9501-gitweb-standalone-http-status.sh +++ b/t/t9501-gitweb-standalone-http-status.sh @@ -100,14 +100,14 @@ test_expect_success 'snapshots: bad tree-ish id (tagged object)' ' echo object > tag-object && git add tag-object && test_tick && git commit -m "Object to be tagged" && - git tag tagged-object `git hash-object tag-object` && + git tag tagged-object $(git hash-object tag-object) && gitweb_run "p=.git;a=snapshot;h=tagged-object;sf=tgz" && grep "400 - Object is not a tree-ish" gitweb.output ' test_debug 'cat gitweb.output' test_expect_success 'snapshots: good object id' ' - ID=`git rev-parse --verify HEAD` && + ID=$(git rev-parse --verify HEAD) && gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" && grep "Status: 200 OK" gitweb.output ' @@ -173,7 +173,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod test_debug 'cat gitweb.headers' test_expect_success DATE_PARSER 'modification: tree snapshot' ' - ID=`git rev-parse --verify HEAD^{tree}` && + ID=$(git rev-parse --verify HEAD^{tree}) && HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" && export HTTP_IF_MODIFIED_SINCE && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && -- 2.5.0