From cb5457b6be1457a7e6fb118d0c7f8164e327cd6b Mon Sep 17 00:00:00 2001 From: Kasper Marinus Date: Mon, 3 Nov 2025 15:29:06 +0100 Subject: [PATCH] feat: check for squash commits ref: N25B-241 --- .githooks/check-commit-msg.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.githooks/check-commit-msg.sh b/.githooks/check-commit-msg.sh index cdf56fb..eacf2a8 100755 --- a/.githooks/check-commit-msg.sh +++ b/.githooks/check-commit-msg.sh @@ -53,6 +53,14 @@ if grep -qE "$CHERRY_PICK_PATTERN" "$COMMIT_MSG_FILE"; then exit 0 fi +# Check for Squash +# Example: "Squash commits ..." +SQUASH_PATTERN="^Squash .+" +if [[ "$HEADER" =~ $SQUASH_PATTERN ]]; then + echo -e "${GREEN}Squash commit detected by message content. Skipping validation.${NC}" + exit 0 +fi + # --- Validation Functions --- # Function to print an error message and exit