From 05b38e67c4d908b9e462c987ef8dc3b96d436e4d Mon Sep 17 00:00:00 2001 From: Matysh Date: Thu, 13 Aug 2026 12:09:02 +0300 Subject: [PATCH] fix(hooks): drop basename from commit-msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hook parsed the message path with basename, an external command. Where it is missing from PATH the substitution yields an empty string, set -e does not trip on it, and the MERGE_MSG guard silently stops working — a generated merge commit would then be rejected for missing trailers it cannot have. POSIX parameter expansion needs no external command and behaves the same in sh, dash, bash and Git Bash. Issue: #116 User-Visible: no --- .githooks/commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 .githooks/commit-msg diff --git a/.githooks/commit-msg b/.githooks/commit-msg old mode 100755 new mode 100644 index ce345123..49e1557a --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -5,7 +5,7 @@ message_file=$1 # Git-generated merge commits do not represent an independently authored # product change and inherit provenance from their parents. -case "$(basename "$message_file")" in +case "${message_file##*/}" in MERGE_MSG) exit 0 ;; esac