From c3669ba9efa751926718f15294f813904f9ea2c7 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 17 Feb 2025 22:08:16 +0800 Subject: [PATCH] ; Move Markdown quotation detection to commit-msg hook * build-aux/git-hooks/prepare-commit-msg: Don't detect markdown quotes here... * build-aux/git-hooks/commit-msg: but here, to intercept interactively composed log messages. (cherry picked from commit ba6779ab2afcd3177c9c118a0383aa21ad1ab45f) --- build-aux/git-hooks/commit-msg | 5 +++++ build-aux/git-hooks/prepare-commit-msg | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg index a8ae70d49d3..a52862bf745 100755 --- a/build-aux/git-hooks/commit-msg +++ b/build-aux/git-hooks/commit-msg @@ -92,6 +92,11 @@ exec $awk \ status = 1 } + /(^|[^\\])`[^'\''`]+`/ { + print "Markdown-style quotes in commit message" + status = 1 + } + nlines == 0 && $0 !~ non_space { next } { nlines++ } diff --git a/build-aux/git-hooks/prepare-commit-msg b/build-aux/git-hooks/prepare-commit-msg index 7761f46e5e0..e8243e157cd 100755 --- a/build-aux/git-hooks/prepare-commit-msg +++ b/build-aux/git-hooks/prepare-commit-msg @@ -40,10 +40,6 @@ exec $awk " print \"'Signed-off-by:' in commit message\" status = 1 } - /(^|[^\\\\])\`[^'\`]+\`/ { - print \"Markdown-style quotes in commit message\" - status = 1 - } END { if (status != 0) { print \"Commit aborted; please see the file 'CONTRIBUTE'\" -- 2.39.5