aboutsummaryrefslogtreecommitdiff
path: root/git-email.el
diff options
context:
space:
mode:
authoryoctocell <public@yoctocell.xyz>2021-01-09 15:51:44 +0100
committeryoctocell <public@yoctocell.xyz>2021-01-09 15:51:44 +0100
commitb98b46466ada12b42c5060ecea3f605a3cb14332 (patch)
tree652e65878bd64f889468a07d94e1bcac805f28da /git-email.el
parent78732e4ab96e4d4485619f7eb9dc4fc9d99f7c44 (diff)
Delete patches after sending them
* git-email.el (git-email-format-patch): Delete the patches generated by 'git format-patch' after sending the emails.
Diffstat (limited to 'git-email.el')
-rw-r--r--git-email.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/git-email.el b/git-email.el
index f3b8aae..e89fcef 100644
--- a/git-email.el
+++ b/git-email.el
@@ -311,11 +311,15 @@ them into the message buffer."
(cadr (log-view-current-entry (point) t))))
;;;###autoload
-(defun git-email-format-patch (&optional args)
+(defun git-email-format-patch (&optional args keep)
"Format and send patch(es) using 'git format-patch'.
+
With optional ARGS (\\[universal-argument]) you can specify extra
arguments to give to 'git format-patch'. By default, the
-arguments in `git-email-format-patch-default-args' will be used."
+arguments in `git-email-format-patch-default-args' will be used.
+
+If KEEP is a non-nil value, keep the generated patches. The default
+behavior is to delete them after sending email."
(interactive "P")
(let* ((rev (or (seq-some (lambda (fn)
(funcall fn))
@@ -340,7 +344,8 @@ arguments in `git-email-format-patch-default-args' will be used."
(dolist (file files)
(run-hooks 'git-email-pre-compose-email-hook)
(git-email--compose-email file)
- (run-hooks 'git-email-post-compose-email-hook))))
+ (run-hooks 'git-email-post-compose-email-hook))
+ (mapc #'delete-file files)))
;;;; Operate on emails
(defun git-email-send-all ()