From 03e04aad14691b8f5e17c533bca525aec2c4ab09 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 19 Dec 2022 12:31:47 -0700 Subject: mailscripts.el: add comment, tweak regexp Signed-off-by: Sean Whitton --- mailscripts.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mailscripts.el') 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")))) -- cgit v1.2.3