Re: [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution
From: Eric Sunshine <hidden>
Date: 2020-09-18 16:57:40
From: Eric Sunshine <hidden>
Date: 2020-09-18 16:57:40
On Fri, Sep 18, 2020 at 7:19 AM Denton Liu [off-list ref] wrote:
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 <redacted> ---diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample@@ -41,7 +41,7 @@ do - commit=`git rev-list -n 1 --grep '^WIP' "$range"` + commit="$(git rev-list -n 1 --grep '^WIP' "$range")"
The double quotes around $(...) are unnecessary and just add noise.
if [ -n "$commit" ]
If you're looking for style fixes, then this would be another candidate (using 'test' instead of '[').