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 /build-aux | |
| 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.
Diffstat (limited to 'build-aux')
| -rwxr-xr-x | build-aux/git-hooks/prepare-commit-msg | 12 |
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" |
| 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" |