From 67b9ef8384ddf4185af34cbd19c7cd808847c2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Mon, 26 Jun 2017 10:08:35 +0100 Subject: [PATCH] mu4e/mu4e-actions: optional apply signoff Maintainers often want to apply patches with their signoff. Support this with an optional argument. --- mu4e/mu4e-actions.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mu4e/mu4e-actions.el b/mu4e/mu4e-actions.el index 412ba6c5..c59a16ec 100644 --- a/mu4e/mu4e-actions.el +++ b/mu4e/mu4e-actions.el @@ -229,8 +229,8 @@ store your org-contacts." path (mu4e-message-field msg :path))))) -(defun mu4e-action-git-apply-mbox (msg) - "Apply and commit the git [patch] MSG. +(defun mu4e-action-git-apply-mbox (msg &optional signoff) + "Apply and commit the git [patch] MSG with optional SIGNOFF. If the `default-directory' matches the most recent history entry don't bother asking for the git tree again (useful for bulk actions)." @@ -243,9 +243,10 @@ bother asking for the git tree again (useful for bulk actions)." (setf ido-work-directory-list (cons cwd (delete cwd ido-work-directory-list)))) (shell-command - (format "cd %s; git am %s" - (shell-quote-argument cwd) - (shell-quote-argument (mu4e-message-field msg :path)))))) + (format "cd %s; git am %s %s" + (shell-quote-argument cwd) + (if signoff "--signoff" "") + (shell-quote-argument (mu4e-message-field msg :path)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;