From: Po Lu Date: Mon, 17 Feb 2025 14:08:16 +0000 (+0800) Subject: ; Move Markdown quotation detection to commit-msg hook X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c3669ba9efa751926718f15294f813904f9ea2c7;p=emacs.git ; 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) --- 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'\"