From ebc4d899b2024b1fe1f5db1edc557144cc2bfc57 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 23 Nov 2023 07:04:58 +0000 Subject: [PATCH] refactor(git-hooks): use long `set` names Use the long name versions for `set` to be consistent with `run` files. --- CHANGELOG.md | 4 ++++ templates/common/.githooks/pre-push.twig | 2 +- templates/common/.githooks/prepare-commit-msg.twig | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bb413b..8100656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ * The `pre-push` Git hook should use `./run test:commit` instead of `just test-commit` since `just` is no longer used. * Recursively merge `build.defaults.yaml` into the given configuration. +### Changed + +* Replace `set -ueo` in Git hook templates to use the long names and be consistent with `run` scripts. + ## 2023-11-22 ### Added diff --git a/templates/common/.githooks/pre-push.twig b/templates/common/.githooks/pre-push.twig index c34b8e3..dca4863 100755 --- a/templates/common/.githooks/pre-push.twig +++ b/templates/common/.githooks/pre-push.twig @@ -2,6 +2,6 @@ # {{ managedText }} -set -euo pipefail +set -o errexit ./run test:commit diff --git a/templates/common/.githooks/prepare-commit-msg.twig b/templates/common/.githooks/prepare-commit-msg.twig index 069b4a4..3e43045 100755 --- a/templates/common/.githooks/prepare-commit-msg.twig +++ b/templates/common/.githooks/prepare-commit-msg.twig @@ -11,7 +11,9 @@ # This also works with multiple issue IDs in the same string, e.g. # "OD-123 OD-456", or IDs on multiple lines. -set -euo pipefail +set -o errexit +set -o nounset +set -o pipefail PROJECT_DIR=$(git rev-parse --show-toplevel) ISSUE_FILE="$PROJECT_DIR/.issue-id"