diff options
-rw-r--r-- | mailscripts.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mailscripts.el b/mailscripts.el index 1d8d406..33b6187 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -41,6 +41,20 @@ If NO-OPEN, don't open the thread." (notmuch-slurp-debbug (match-string 1 subject) t)) (notmuch-refresh-this-buffer))) +;;;###autoload +(defun notmuch-extract-thread-patches (repo branch) + "Extract patch series in current thread to new branch BRANCH in repo REPO." + (interactive "Dgit repo: \nsnew branch name: ") + (let ((thread-id notmuch-show-thread-id) + (default-directory (expand-file-name repo))) + (call-process-shell-command + (format "git checkout -b %s" + (shell-quote-argument branch))) + (shell-command + (format "notmuch-extract-patch %s | git am" + (shell-quote-argument thread-id)) + "*notmuch-apply-thread-series*"))) + (provide 'mailscripts) ;;; mailscripts.el ends here |