diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-02 09:52:46 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-02 09:54:07 -0700 |
commit | 8d2dcb9d14a681c3ba86dc2f67756a5619f4d10d (patch) | |
tree | 4ef76e230fda4d8e91aced031e6a636930005e44 | |
parent | fdf112b63eb755fcaa5138567ed0428eea3957ff (diff) | |
download | mailscripts-8d2dcb9d14a681c3ba86dc2f67756a5619f4d10d.tar.gz |
mailscripts.el: add mailscripts-extract-patches-branch-prefix
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | mailscripts.el | 24 |
2 files changed, 21 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 149b4e1..6f57add 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ mailscripts (0.12-1) UNRELEASED; urgency=medium * email-print-mime-structure: add capability to decrypt message parts (Closes: #943959). Thanks to Daniel Kahn Gillmor for the patch series. + * mailscripts.el: add mailscripts-extract-patches-branch-prefix defcustom. -- Sean Whitton <spwhitton@spwhitton.name> Fri, 01 Nov 2019 20:38:07 -0700 diff --git a/mailscripts.el b/mailscripts.el index 3d3a584..a2ec230 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -4,7 +4,7 @@ ;; Version: 0.12 ;; Package-Requires: (notmuch) -;; Copyright (C) 2018 Sean Whitton +;; Copyright (C) 2018, 2019 Sean Whitton ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -23,6 +23,16 @@ (require 'notmuch) +(defgroup mailscripts nil + "Customisation of functions in the mailscripts package.") + +(defcustom mailscripts-extract-patches-branch-prefix nil + "Prefix for git branches created by functions which extract patch series. + +E.g. `mailed/'." + :type 'string + :group 'mailscripts) + ;;;###autoload (defun notmuch-slurp-debbug (bug &optional no-open) "Slurp Debian bug with bug number BUG and open the thread in notmuch. @@ -54,14 +64,20 @@ threads to the notmuch-extract-patch(1) command." (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))) + (mailscripts--check-out-branch branch) (shell-command (format "notmuch-extract-patch %s | git am" (shell-quote-argument thread-id)) "*notmuch-apply-thread-series*"))) +(defun mailscripts--check-out-branch (branch) + (call-process-shell-command + (format "git checkout -b %s" + (shell-quote-argument + (if mailscripts-extract-patches-branch-prefix + (concat mailscripts-extract-patches-branch-prefix branch) + branch))))) + (provide 'mailscripts) ;;; mailscripts.el ends here |