From 9a905a7d86867bab8a5d9befd40a67a6ab9aaea2 Mon Sep 17 00:00:00 2001 From: Chris Kay Date: Tue, 18 Apr 2023 17:32:41 +0100 Subject: [PATCH] build(hooks): allow hooks to skip Commitizen Adds a conditional check in the `prepare-commit-msg` commit hook that reads the `tf-a.disableCommitizen` Git configuration option, and does not execute Commitizen if it is found. To skip Commitizen, run: git config tf-a.disableCommitizen true Change-Id: Ic8967f6f42bf3555df09b57096044fb99438d4d4 Signed-off-by: Chris Kay --- .husky/prepare-commit-msg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg index 593dfa88b..617400ae5 100755 --- a/.husky/prepare-commit-msg +++ b/.husky/prepare-commit-msg @@ -3,4 +3,6 @@ # shellcheck source=./_/husky.sh . "$(dirname "$0")/_/husky.sh" -"$(dirname "$0")/prepare-commit-msg.cz" "$@" +if ! git config --get tf-a.disableCommitizen > /dev/null; then + "$(dirname "$0")/prepare-commit-msg.cz" "$@" +fi -- 2.39.5