]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
build(hooks): allow hooks to skip Commitizen
authorChris Kay <chris.kay@arm.com>
Tue, 18 Apr 2023 16:32:41 +0000 (17:32 +0100)
committerChris Kay <chris.kay@arm.com>
Tue, 18 Apr 2023 16:38:20 +0000 (17:38 +0100)
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 <chris.kay@arm.com>
.husky/prepare-commit-msg

index 593dfa88b56606d4f42d76ce7b941886dcf4ad72..617400ae5d9802887c13e7a96f1124a74661a999 100755 (executable)
@@ -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