diff options
| author | Po Lu | 2025-02-17 15:17:00 +0800 |
|---|---|---|
| committer | Po Lu | 2025-02-17 15:17:37 +0800 |
| commit | 0e4d08f3dc7c76008da9cd912933a931c6e3e8d9 (patch) | |
| tree | 7b1d54df25901b5da53cf104790d18129f6f02e7 | |
| parent | 89bdb57f24e0bdc1a3d33d7124d93c9a1b45fa1d (diff) | |
| download | emacs-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.
| -rw-r--r-- | CONTRIBUTE | 10 | ||||
| -rwxr-xr-x | build-aux/git-hooks/prepare-commit-msg | 12 |
2 files changed, 14 insertions, 8 deletions
diff --git a/CONTRIBUTE b/CONTRIBUTE index 0ab45a99ee2..336f6f0ce00 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE | |||
| @@ -276,10 +276,12 @@ formatting them: | |||
| 276 | 276 | ||
| 277 | - Emacs follows the GNU coding standards for ChangeLog entries: see | 277 | - Emacs follows the GNU coding standards for ChangeLog entries: see |
| 278 | https://www.gnu.org/prep/standards/html_node/Change-Logs.html or run | 278 | https://www.gnu.org/prep/standards/html_node/Change-Logs.html or run |
| 279 | 'info "(standards)Change Logs"'. One exception is that commits | 279 | 'info "(standards)Change Logs"'. One exception is that commits still |
| 280 | still sometimes quote `like-this' (as the standards used to | 280 | sometimes quote `like-this' (as the standards used to recommend) |
| 281 | recommend) rather than 'like-this' or ‘like this’ (as they do now), | 281 | rather than 'like-this' or ‘like this’ (as they do now), as `...' is |
| 282 | as `...' is so widely used elsewhere in Emacs. | 282 | so widely used elsewhere in Emacs. Please do not adopt the ugly |
| 283 | Markdown convention where quoting is performed with pairs of backticks | ||
| 284 | in any circumstances. That is to say, never quote `like this`. | ||
| 283 | 285 | ||
| 284 | - Some commenting rules in the GNU coding standards also apply | 286 | - Some commenting rules in the GNU coding standards also apply |
| 285 | to ChangeLog entries: they must be in English, and be complete | 287 | to ChangeLog entries: they must be in English, and be complete |
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" |
| 34 | fi | 34 | fi |
| 35 | 35 | ||
| 36 | exec $awk ' | 36 | exec $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" |