]> git.eshelyaron.com Git - emacs.git/commitdiff
; More strongly discountenance Markdown-style quotes
authorPo Lu <luangruo@yahoo.com>
Mon, 17 Feb 2025 07:17:00 +0000 (15:17 +0800)
committerEshel Yaron <me@eshelyaron.com>
Tue, 18 Feb 2025 08:51:47 +0000 (09:51 +0100)
* CONTRIBUTE (Commit messages): Discourage quoting with
Markdown-style pairs of backticks.

* build-aux/git-hooks/prepare-commit-msg: Detect and reject
commit messages with Markdown-style quotes.

(cherry picked from commit 0e4d08f3dc7c76008da9cd912933a931c6e3e8d9)

CONTRIBUTE
build-aux/git-hooks/prepare-commit-msg

index 0ab45a99ee28dcc585cf5b6f6cd6093160493ef3..336f6f0ce0028fd3636194469293a5949495a4f6 100644 (file)
@@ -276,10 +276,12 @@ formatting them:
 
 - Emacs follows the GNU coding standards for ChangeLog entries: see
   https://www.gnu.org/prep/standards/html_node/Change-Logs.html or run
-  'info "(standards)Change Logs"'.  One exception is that commits
-  still sometimes quote `like-this' (as the standards used to
-  recommend) rather than 'like-this' or ‘like this’ (as they do now),
-  as `...' is so widely used elsewhere in Emacs.
+  'info "(standards)Change Logs"'.  One exception is that commits still
+  sometimes quote `like-this' (as the standards used to recommend)
+  rather than 'like-this' or ‘like this’ (as they do now), as `...' is
+  so widely used elsewhere in Emacs.  Please do not adopt the ugly
+  Markdown convention where quoting is performed with pairs of backticks
+  in any circumstances.  That is to say, never quote `like this`.
 
 - Some commenting rules in the GNU coding standards also apply
   to ChangeLog entries: they must be in English, and be complete
index eefecaa1556cf771284b284a554bd25d325f2ce6..7761f46e5e03a01bf1b573414cb3dd97f071aeef 100755 (executable)
@@ -33,17 +33,21 @@ else
   awk="awk"
 fi
 
-exec $awk '
+exec $awk "
   # Catch the case when someone ran git-commit with -s option,
   # which automatically adds Signed-off-by.
   /^Signed-off-by: / {
-    print "'\''Signed-off-by:'\'' in commit message"
+    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'"
+      print \"Commit aborted; please see the file 'CONTRIBUTE'\"
     }
     exit status
   }
-' <"$COMMIT_MSG_FILE"
+" <"$COMMIT_MSG_FILE"