aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
authorPo Lu2025-02-17 15:17:00 +0800
committerPo Lu2025-02-17 15:17:37 +0800
commit0e4d08f3dc7c76008da9cd912933a931c6e3e8d9 (patch)
tree7b1d54df25901b5da53cf104790d18129f6f02e7 /build-aux
parent89bdb57f24e0bdc1a3d33d7124d93c9a1b45fa1d (diff)
downloademacs-0e4d08f3dc7c76008da9cd912933a931c6e3e8d9.tar.gz
emacs-0e4d08f3dc7c76008da9cd912933a931c6e3e8d9.zip
; More strongly discountenance Markdown-style quotes
* 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.
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/git-hooks/prepare-commit-msg12
1 files changed, 8 insertions, 4 deletions
diff --git a/build-aux/git-hooks/prepare-commit-msg b/build-aux/git-hooks/prepare-commit-msg
index eefecaa1556..7761f46e5e0 100755
--- a/build-aux/git-hooks/prepare-commit-msg
+++ b/build-aux/git-hooks/prepare-commit-msg
@@ -33,17 +33,21 @@ else
33 awk="awk" 33 awk="awk"
34fi 34fi
35 35
36exec $awk ' 36exec $awk "
37 # Catch the case when someone ran git-commit with -s option, 37 # Catch the case when someone ran git-commit with -s option,
38 # which automatically adds Signed-off-by. 38 # which automatically adds Signed-off-by.
39 /^Signed-off-by: / { 39 /^Signed-off-by: / {
40 print "'\''Signed-off-by:'\'' in commit message" 40 print \"'Signed-off-by:' in commit message\"
41 status = 1
42 }
43 /(^|[^\\\\])\`[^'\`]+\`/ {
44 print \"Markdown-style quotes in commit message\"
41 status = 1 45 status = 1
42 } 46 }
43 END { 47 END {
44 if (status != 0) { 48 if (status != 0) {
45 print "Commit aborted; please see the file 'CONTRIBUTE'" 49 print \"Commit aborted; please see the file 'CONTRIBUTE'\"
46 } 50 }
47 exit status 51 exit status
48 } 52 }
49' <"$COMMIT_MSG_FILE" 53" <"$COMMIT_MSG_FILE"