From owner-dev-commits-src-main@freebsd.org Thu Jan 7 14:01:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5FFE4D1DA7; Thu, 7 Jan 2021 14:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DBSZX69jRz55Tn; Thu, 7 Jan 2021 14:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6F2B1241E; Thu, 7 Jan 2021 14:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 107E1OUU039428; Thu, 7 Jan 2021 14:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 107E1OXJ039427; Thu, 7 Jan 2021 14:01:24 GMT (envelope-from git) Date: Thu, 7 Jan 2021 14:01:24 GMT Message-Id: <202101071401.107E1OXJ039427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: d146f831801f - main - prepare-commit-msg: Avoid warning on macOS and shellcheck fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d146f831801f226802e3e1d55bec2cfbea9dc577 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2021 14:01:25 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d146f831801f226802e3e1d55bec2cfbea9dc577 commit d146f831801f226802e3e1d55bec2cfbea9dc577 Author: Alex Richardson AuthorDate: 2021-01-07 14:00:32 +0000 Commit: Alex Richardson CommitDate: 2021-01-07 14:00:32 +0000 prepare-commit-msg: Avoid warning on macOS and shellcheck fixes The macOS /bin/sh complains about using return outside of functions. Replace `return 0` with `exit 0` to fix this. While editing this files I've also fixed all the shellcheck warnings that were displayed by my IDE. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28016 --- tools/tools/git/hooks/prepare-commit-msg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index e453b73cc45d..51b92a10724d 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -13,13 +13,13 @@ commit|message) # It appears git invokes this script for interactive rebase but does # not remove commented lines, so just exit if we're not called with the # default (comment-containing) template. - egrep -q '^#' "$1" || return 0 + grep -E -q '^#' "$1" || exit 0 ;; template) - return 0 + exit 0 ;; merge) - return 0 + exit 0 ;; esac @@ -58,7 +58,7 @@ $(awk '1;/^#$/{exit}' $1) # # "Pull Request" and "Differential Revision" require the *full* GitHub or # Phabricator URL. -$(awk '/^#$/,EOF' $1) +$(awk '/^#$/,EOF' "$1") EOF -mv $outfile $1 +mv "$outfile" "$1"