diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2018-07-26 16:04:59 +0800 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2018-07-26 16:16:46 +0800 |
commit | c62156e618ede0c4e069cb40107ad931be580f8e (patch) | |
tree | ff8d6cacf6fff20ba3a3aa49709e0e3850fcf222 /mailscripts.el | |
parent | 2e72667de60536257e2ae52e6f86a12e7a469eed (diff) | |
download | mailscripts-c62156e618ede0c4e069cb40107ad931be580f8e.tar.gz |
mailscripts.el: add `notmuch-extract-thread-patches'
Adapted from Aurelien Aptel's example in notmuch-extract-patch/README.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'mailscripts.el')
-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 |