All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: "brian m . carlson" <sandals@crustytoothpaste.net>
Subject: [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution
Date: Fri, 18 Sep 2020 04:19:02 -0700	[thread overview]
Message-ID: <ed1ade73281bb78ab3a1d4fd1291a951ca52f0b4.1600427894.git.liu.denton@gmail.com> (raw)
In-Reply-To: <cover.1600427894.git.liu.denton@gmail.com>

The preferred form for a command substitution is $() over ``. Use this
form for the command substitution in the sample hook.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 templates/hooks--pre-push.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
index 6187dbf439..64b5707553 100755
--- a/templates/hooks--pre-push.sample
+++ b/templates/hooks--pre-push.sample
@@ -41,7 +41,7 @@ do
 		fi
 
 		# Check for WIP commit
-		commit=`git rev-list -n 1 --grep '^WIP' "$range"`
+		commit="$(git rev-list -n 1 --grep '^WIP' "$range")"
 		if [ -n "$commit" ]
 		then
 			echo >&2 "Found WIP commit in $local_ref, not pushing"
-- 
2.28.0.618.gf4bc123cb7


  reply	other threads:[~2020-09-18 11:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
2020-09-18 11:19 ` Denton Liu [this message]
2020-09-18 16:57   ` [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution Eric Sunshine
2020-09-18 11:19 ` [PATCH 2/4] builtin/rev-parse: learn --null-oid Denton Liu
2020-09-18 14:11   ` Taylor Blau
2020-09-18 14:16     ` Taylor Blau
2020-09-18 18:16       ` Junio C Hamano
2020-09-18 18:21         ` Taylor Blau
2020-09-18 21:26     ` brian m. carlson
2020-09-20  4:25       ` Chris Torek
2020-09-20 18:58         ` brian m. carlson
2020-09-20 15:35       ` Taylor Blau
2020-09-20 16:03       ` Andreas Schwab
2020-09-18 11:19 ` [PATCH 3/4] hooks--pre-push.sample: use hash-agnostic null OID Denton Liu
2020-09-18 17:06   ` Eric Sunshine
2020-09-18 11:19 ` [PATCH 4/4] hooks--update.sample: " Denton Liu
2020-09-18 17:08   ` Eric Sunshine
2020-09-18 21:35 ` [PATCH 0/4] sample hooks: become hash agnostic brian m. carlson
2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
2020-09-23  9:38   ` [PATCH v2 1/3] hooks--pre-push.sample: modernize script Denton Liu
2020-09-23  9:38   ` [PATCH v2 2/3] hooks--pre-push.sample: use hash-agnostic zero OID Denton Liu
2020-09-23  9:38   ` [PATCH v2 3/3] hooks--update.sample: " Denton Liu
2020-09-23 16:34   ` [PATCH v2 0/3] sample hooks: become hash agnostic Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed1ade73281bb78ab3a1d4fd1291a951ca52f0b4.1600427894.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.