From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 875C11F4B4 for ; Fri, 18 Sep 2020 16:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726280AbgIRQ5j (ORCPT ); Fri, 18 Sep 2020 12:57:39 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:34823 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgIRQ5j (ORCPT ); Fri, 18 Sep 2020 12:57:39 -0400 Received: by mail-ed1-f67.google.com with SMTP id i1so6807363edv.2 for ; Fri, 18 Sep 2020 09:57:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3yWzgXk6xGlVtvMMYsrwhAHd5nm8kQwzv0C5OTdN3FE=; b=M0t6m4cG+bcTTBWfO+AinZlF6hNFj4xtFuGwvksGKBnDbAPC5UVkgAKuzQfN/yeQG3 /YxXTh6eaQkTWtzvuAsGL+klHTQUi95keku4NHFer0FjhJNODEozwewjUL2zYiubHVcH MwEjBk7tWrACDJsGxILccm/IYOePG86baYWbc+0dLmbQphj1plMALkfM1bkzTOp9mi3Y 57rklD3u3JS3agpnjMeCP5QMZ/Ck53XXY+ZMvDnzSIrRotGFQazF0qTnPIfMLFpCsMRv 1pKGrDrWuRlOUisdGrMhiJp6X7+aH2T1DzyyeIWjtKfJmPeZVtp8oOFTB1RwZBIY+ru1 TRNA== X-Gm-Message-State: AOAM532HQsRKxlcTetRKtTtFbjsHhjRTXKryRXU2JmAA50c4KX/aQmRz kB8chiDFm4lM/ctBWXfvEJTzU5ThNOu4XZF/dNajAajO X-Google-Smtp-Source: ABdhPJwwQWL5v/CGFGhaVMMG7L/1GhewEwhgP8ARrwrNoVIaQy/AX2WNefIMCGz1/YxIhuANPkshbREEcdyS+fBCNcA= X-Received: by 2002:aa7:ca4f:: with SMTP id j15mr36006537edt.233.1600448257737; Fri, 18 Sep 2020 09:57:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Sunshine Date: Fri, 18 Sep 2020 12:57:26 -0400 Message-ID: Subject: Re: [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution To: Denton Liu Cc: Git Mailing List , "brian m . carlson" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Sep 18, 2020 at 7:19 AM Denton Liu 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 > --- > 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 '[').