]> git.eshelyaron.com Git - emacs.git/commitdiff
; Move Markdown quotation detection to commit-msg hook
authorPo Lu <luangruo@yahoo.com>
Mon, 17 Feb 2025 14:08:16 +0000 (22:08 +0800)
committerEshel Yaron <me@eshelyaron.com>
Tue, 18 Feb 2025 08:52:54 +0000 (09:52 +0100)
* 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
build-aux/git-hooks/prepare-commit-msg

index a8ae70d49d350af24d8f73281b8d6717deddf3e2..a52862bf74535a9e6582335253de1d9ac2a693e5 100755 (executable)
@@ -92,6 +92,11 @@ exec $awk \
     status = 1
   }
 
+  /(^|[^\\])`[^'\''`]+`/ {
+    print "Markdown-style quotes in commit message"
+    status = 1
+  }
+
   nlines == 0 && $0 !~ non_space { next }
 
   { nlines++ }
index 7761f46e5e03a01bf1b573414cb3dd97f071aeef..e8243e157cdeb10721252d4991723780c9457962 100755 (executable)
@@ -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'\"