summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2022-10-22 14:05:44 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2022-10-22 14:16:13 +0200
commit85aff4de30686359ffb50845eb0930c0a18dc8ba (patch)
tree42c9c30ca0534694f59ed19028b6092e9ed89f60 /etc
parent28270e1e039b6e05bf7a17b9b660801df2d588bd (diff)
snippets: Harden for review activity.
When reviewing patches, whose commit logs don't follow the structure outlined in “Submitting Patches”, a reviewer might be tempted to use snippets to rewrite them. This makes it so that their attempt, while not immediately succeeding, isn't completely thwarted. * etc/snippets/tempel/text-mode (add\ , remove\ , rename\ , update\ ) (addcl\ , https\ ): Use an empty "p" field if (car (magit-staged-files)) fails.
Diffstat (limited to 'etc')
-rw-r--r--etc/snippets/tempel/text-mode15
1 files changed, 9 insertions, 6 deletions
diff --git a/etc/snippets/tempel/text-mode b/etc/snippets/tempel/text-mode
index 364c21266d7..fd0e95eaa6e 100644
--- a/etc/snippets/tempel/text-mode
+++ b/etc/snippets/tempel/text-mode
@@ -12,7 +12,8 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
12 (match-string-no-properties 1))) 12 (match-string-no-properties 1)))
13 var) 13 var)
14 "." n n 14 "." n n
15 "* " (car (magit-staged-files)) " (" (s var ) "): New variable.") 15 "* " (p (or (car (magit-staged-files)) ""))
16 " (" (s var ) "): New variable.")
16 17
17(remove\ "gnu: Remove " 18(remove\ "gnu: Remove "
18 (p (with-temp-buffer 19 (p (with-temp-buffer
@@ -24,7 +25,8 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
24 (match-string-no-properties 1))) 25 (match-string-no-properties 1)))
25 var) 26 var)
26 "." n n 27 "." n n
27 "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.") 28 "* " (p (or (car (magit-staged-files)) ""))
29 " (" (s var) "): Delete variable.")
28 30
29(rename\ "gnu: " 31(rename\ "gnu: "
30 (p (with-temp-buffer 32 (p (with-temp-buffer
@@ -43,7 +45,7 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
43 (thing-at-point 'sexp 'no-properties))) 45 (thing-at-point 'sexp 'no-properties)))
44 new-var) 46 new-var)
45 "." n n 47 "." n n
46 "* " (car (magit-staged-files)) " (" (s prev-var) "): " 48 "* " (p (or (car (magit-staged-files)) "")) " (" (s prev-var) "): "
47 "Define in terms of" n 49 "Define in terms of" n
48 "'deprecated-package'." n 50 "'deprecated-package'." n
49 "(" (s new-var) "): New variable, formerly known as \"" 51 "(" (s new-var) "): New variable, formerly known as \""
@@ -74,7 +76,7 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
74 (buffer-substring-no-properties (point) (- end 2)))))) 76 (buffer-substring-no-properties (point) (- end 2))))))
75 version) 77 version)
76 "." n n 78 "." n n
77 "* " (car (magit-staged-files)) " (" (s var) "): " 79 "* " (p (or (car (magit-staged-files)) "")) " (" (s var) "): "
78 "Update to " (s version) "." n 80 "Update to " (s version) "." n
79 (mapconcat (lambda (file) (concat "* " file)) 81 (mapconcat (lambda (file) (concat "* " file))
80 (cdr (magit-staged-files)) 82 (cdr (magit-staged-files))
@@ -92,7 +94,7 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
92 (thing-at-point 'sexp 'no-properties))))) 94 (thing-at-point 'sexp 'no-properties)))))
93 var) 95 var)
94 "." n n 96 "." n n
95 "* " (car (magit-staged-files)) 97 "* " (p (or (car (magit-staged-files)) ""))
96 " (cl-" (s var) 98 " (cl-" (s var)
97 ", ecl-" (s var) 99 ", ecl-" (s var)
98 ", sbcl-" (s var) "): New variables.") 100 ", sbcl-" (s var) "): New variables.")
@@ -107,7 +109,8 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
107 (match-string-no-properties 1))) 109 (match-string-no-properties 1)))
108 var) 110 var)
109 ": Use HTTPS home page." n n 111 ": Use HTTPS home page." n n
110 "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS." 112 "* " (p (or (car (magit-staged-files)) ""))
113 " (" (s var) ")[home-page]: Use HTTPS."
111 n 114 n
112 (mapconcat (lambda (file) (concat "* " file)) 115 (mapconcat (lambda (file) (concat "* " file))
113 (cdr (magit-staged-files)) 116 (cdr (magit-staged-files))