summaryrefslogtreecommitdiff
path: root/mailscripts.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-12-19 12:31:47 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-12-19 13:32:44 -0700
commit03e04aad14691b8f5e17c533bca525aec2c4ab09 (patch)
treea431873ebe195729b67186200fe0a0edde02c11e /mailscripts.el
parent7e26a2dfedeaf5fceab20807d52808388d9379d0 (diff)
downloadmailscripts-03e04aad14691b8f5e17c533bca525aec2c4ab09.tar.gz
mailscripts.el: add comment, tweak regexp
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'mailscripts.el')
-rw-r--r--mailscripts.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/mailscripts.el b/mailscripts.el
index c6bb5e5..ecb13c3 100644
--- a/mailscripts.el
+++ b/mailscripts.el
@@ -197,6 +197,9 @@ The target branch may or may not already exist.
Patches are applied using git-am(1), so we only consider
attachments with filenames which look like they were generated by
git-format-patch(1)."
+ ;; See `debbugs-gnu-apply-patch' in debbugs-gnu.el for other ideas about
+ ;; identifying which attachments are the patches to be applied.
+ ;; We could make it a defcustom, so that users can supply their own filters.
(interactive
"Dgit repo: \nsnew branch name (or leave blank to apply to current HEAD): ")
(let ((default-directory (expand-file-name repo))
@@ -213,8 +216,9 @@ git-format-patch(1)."
(lambda (h)
(and-let*
((filename (cdr (assq 'filename (mm-handle-disposition h)))))
- (string-match "^\\(v?[0-9]+\\)-.+\\.\\(patch\\|diff\\|txt\\)$"
- filename)))
+ (string-match
+ "\\`\\(?:v?[0-9]+\\)-.+\\.\\(?:patch\\|diff\\|txt\\)\\'"
+ filename)))
handles)
(mailscripts--check-out-branch branch)
(dolist (handle handles) (mm-pipe-part handle "git am"))))