From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 012/14] git-tag.sh: use the $( ... ) construct for command substitution Date: Wed, 16 Apr 2014 10:29:56 -0700 Message-ID: <1397669398-25410-12-git-send-email-gitter.spiros@gmail.com> References: <1397669398-25410-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Apr 16 19:31:54 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 1WaTgf-0007gc-I0 for gcvg-git-2@plane.gmane.org; Wed, 16 Apr 2014 19:31:53 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753322AbaDPRbg (ORCPT ); Wed, 16 Apr 2014 13:31:36 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:52425 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755304AbaDPRaU (ORCPT ); Wed, 16 Apr 2014 13:30:20 -0400 Received: by mail-pd0-f172.google.com with SMTP id p10so11033966pdj.3 for ; Wed, 16 Apr 2014 10:30:20 -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:in-reply-to:references; bh=1JDkMIG7YLhsiisJmd538yXtM581NobhvY4NitZjjzE=; b=fymdZTGhNzf3y4+0xHoRfaW0KKMJhYyIBdVlze8F0wLfqgkWytHOruRJtHdPIhkbxA 731vC5AZYj7xM8Rvs49aKraX6UBOva7ShikzS1F3UjrCLPldGmldNhZqBy+by28NNoDD P7Vo/bfHed88Vtu4TCMiwLXrnFARr0iLgJCZKLNV1vUD1nrVxZ+pzV+zmQQ98Xku8hTC J37IQQbe1pKv6rygcbkpG9wLv0hcO/etzypt4QJKxW+EuNn3jNa0V2GBZ1N00DzveNyn BsHlASU3hkkNWdyGzWQyNzdPD+e6mpoZb6yS150/hUB708nwNLeWzK1KFmM+sKgAB1Gf 6WXA== X-Received: by 10.66.233.9 with SMTP id ts9mr9908203pac.37.1397669419778; Wed, 16 Apr 2014 10:30:19 -0700 (PDT) Received: from devzero2000ubu.nephoscale.com (140.195.207.67.nephoscale.net. [67.207.195.140]) by mx.google.com with ESMTPSA id z3sm113974244pas.15.2014.04.16.10.30.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Apr 2014 10:30:19 -0700 (PDT) X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397669398-25410-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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto --- contrib/examples/git-tag.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh index 2c15bc9..1bd8f3c 100755 --- a/contrib/examples/git-tag.sh +++ b/contrib/examples/git-tag.sh @@ -156,7 +156,7 @@ prev=0000000000000000000000000000000000000000 if git show-ref --verify --quiet -- "refs/tags/$name" then test -n "$force" || die "tag '$name' already exists" - prev=`git rev-parse "refs/tags/$name"` + prev=$(git rev-parse "refs/tags/$name") fi shift git check-ref-format "tags/$name" || -- 1.7.10.4