From 9c2a3cafdd25d19d94e53942cf170afd6af635d7 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 6 Nov 2019 20:42:28 -0700 Subject: Revert "make it possible to suppress prefixing to the branch name" This reverts commit 3d33e7c0483bb9ab8de3ffd6a0372c8d2a0bffa0. Commit 7360648, which allows the user to suppress branch checkout, is a better way to let the user override their configured mailscripts-extract-patches-branch-prefix. Signed-off-by: Sean Whitton --- mailscripts.el | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/mailscripts.el b/mailscripts.el index 43d06d0..1e8cf93 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -54,51 +54,45 @@ If NO-OPEN, don't open the thread." (notmuch-refresh-this-buffer))) ;;;###autoload -(defun notmuch-extract-thread-patches (repo branch &optional no-prefix) +(defun notmuch-extract-thread-patches (repo branch) "Extract patch series in current thread to branch BRANCH in repo REPO. -A prefix arg suppresses the effects of -`mailscripts-extract-patches-branch-prefix'. - The target branch may or may not already exist. See notmuch-extract-patch(1) manpage for limitations: in particular, this Emacs Lisp function supports passing only entire threads to the notmuch-extract-patch(1) command." (interactive - "Dgit repo: \nsbranch name (or leave blank to apply to current HEAD): \nP") + "Dgit repo: \nsbranch name (or leave blank to apply to current HEAD): ") (let ((thread-id notmuch-show-thread-id) (default-directory (expand-file-name repo))) - (mailscripts--check-out-branch branch no-prefix) + (mailscripts--check-out-branch branch) (shell-command (format "notmuch-extract-patch %s | git am" (shell-quote-argument thread-id)) "*notmuch-apply-thread-series*"))) ;;;###autoload -(defun notmuch-extract-thread-patches-projectile (&optional no-prefix) +(defun notmuch-extract-thread-patches-projectile () "Like `notmuch-extract-thread-patches', but use projectile to choose the repo." - (interactive "P") + (interactive) (mailscripts--projectile-repo-and-branch 'notmuch-extract-thread-patches)) ;;;###autoload -(defun notmuch-extract-message-patches (repo branch &optional no-prefix) +(defun notmuch-extract-message-patches (repo branch) "Extract patches attached to current message to branch BRANCH in repo REPO. -A prefix arg suppresses the effects of -`mailscripts-extract-patches-branch-prefix'. - The target branch may or may not already exist. Patches are applied using git-am(1), so we only consider attachments with filenames which look like they were generated by git-format-patch(1)." (interactive - "Dgit repo: \nsbranch name (or leave blank to apply to current HEAD): \nP") + "Dgit repo: \nsbranch name (or leave blank to apply to current HEAD): ") (with-current-notmuch-show-message (let ((default-directory (expand-file-name repo)) (mm-handle (mm-dissect-buffer))) - (mailscripts--check-out-branch branch no-prefix) + (mailscripts--check-out-branch branch) (notmuch-foreach-mime-part (lambda (p) (let* ((disposition (mm-handle-disposition p)) @@ -110,17 +104,17 @@ git-format-patch(1)." mm-handle)))) ;;;###autoload -(defun notmuch-extract-message-patches-projectile (&optional no-prefix) +(defun notmuch-extract-message-patches-projectile () "Like `notmuch-extract-message-patches', but use projectile to choose the repo." - (interactive "P") + (interactive) (mailscripts--projectile-repo-and-branch 'notmuch-extract-message-patches)) -(defun mailscripts--check-out-branch (branch no-prefix) +(defun mailscripts--check-out-branch (branch) (unless (string= branch "") (call-process-shell-command (format "git checkout -b %s" (shell-quote-argument - (if (and (not no-prefix) mailscripts-extract-patches-branch-prefix) + (if mailscripts-extract-patches-branch-prefix (concat mailscripts-extract-patches-branch-prefix branch) branch)))))) -- cgit v1.2.3