mu4e/mu4e-actions: optional apply signoff

Maintainers often want to apply patches with their signoff. Support
this with an optional argument.
This commit is contained in:
Alex Bennée
2017-06-26 10:08:35 +01:00
parent 7a8d43dc5f
commit 67b9ef8384

View File

@ -229,8 +229,8 @@ store your org-contacts."
path path
(mu4e-message-field msg :path))))) (mu4e-message-field msg :path)))))
(defun mu4e-action-git-apply-mbox (msg) (defun mu4e-action-git-apply-mbox (msg &optional signoff)
"Apply and commit the git [patch] MSG. "Apply and commit the git [patch] MSG with optional SIGNOFF.
If the `default-directory' matches the most recent history entry don't If the `default-directory' matches the most recent history entry don't
bother asking for the git tree again (useful for bulk actions)." 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 (setf ido-work-directory-list
(cons cwd (delete cwd ido-work-directory-list)))) (cons cwd (delete cwd ido-work-directory-list))))
(shell-command (shell-command
(format "cd %s; git am %s" (format "cd %s; git am %s %s"
(shell-quote-argument cwd) (shell-quote-argument cwd)
(shell-quote-argument (mu4e-message-field msg :path)))))) (if signoff "--signoff" "")
(shell-quote-argument (mu4e-message-field msg :path))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;