summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"))))