From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elia Pinto Subject: [PATCH 04/10] t/t7504-commit-msg-hook.sh: use the $( ... ) construct for command substitution Date: Fri, 8 Jan 2016 12:06:22 +0100 Message-ID: <1452251188-12939-5-git-send-email-gitter.spiros@gmail.com> References: <1452251188-12939-1-git-send-email-gitter.spiros@gmail.com> Cc: Elia Pinto To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Jan 08 12:06:53 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 1aHUsc-0002wj-R6 for gcvg-git-2@plane.gmane.org; Fri, 08 Jan 2016 12:06:51 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754722AbcAHLGk (ORCPT ); Fri, 8 Jan 2016 06:06:40 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:32960 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbcAHLGh (ORCPT ); Fri, 8 Jan 2016 06:06:37 -0500 Received: by mail-pf0-f194.google.com with SMTP id e65so618823pfe.0 for ; Fri, 08 Jan 2016 03:06:37 -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=OVO9tyoABpndJQU4IAbjhpkOd4HZPgDw0sLanlOOUz8=; b=xZCbfol120sOkKYEvENBEB2zZM/XSPeA8r8OgK+35ZLJGaM6A9WJntS9Himxg/9VFf O7t//HadxcNLe9Mckh8MXMkJ1edRHHwDJQNT/m/W+0XtrHsr0XzWpX54sMUD/SfVcn7B l9GRqkgh0yQRvDKZwOAzky5xcyOhSf27oo517IeW0e01/6R1dG21zTxLQque5aqbsi9C vtmeteXqk8Wl3GZpk0rw2DCO2xrGzW02Erp1A1mowS1es0NXLj9d3Iu4rDZ8S7HukOXL XNtmqNfbRKqKZ++P45agL4SnnGU5duR11iUfgs7eVBJeZKDx+Gs/VYdljbhnGQekAyBa zE1w== X-Received: by 10.98.13.77 with SMTP id v74mr3404093pfi.162.1452251196880; Fri, 08 Jan 2016 03:06:36 -0800 (PST) Received: from ubuntu14.nephoscale.com (static-67.207.195.141.nephosdns.com. [67.207.195.141]) by smtp.gmail.com with ESMTPSA id fi16sm93143771pac.12.2016.01.08.03.06.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 03:06:36 -0800 (PST) X-Mailer: git-send-email 2.3.3.GIT In-Reply-To: <1452251188-12939-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/t7504-commit-msg-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh index 1f53ea8..8728db6 100755 --- a/t/t7504-commit-msg-hook.sh +++ b/t/t7504-commit-msg-hook.sh @@ -179,7 +179,7 @@ EOF chmod +x "$HOOK" commit_msg_is () { - test "`git log --pretty=format:%s%b -1`" = "$1" + test "$(git log --pretty=format:%s%b -1)" = "$1" } test_expect_success 'hook edits commit message' ' -- 2.3.3.GIT