diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-01-07 14:22:53 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-01-07 14:39:45 -0700 |
commit | fa6bbfd2d65f3ec255e92bda30e8112dbe603bfc (patch) | |
tree | 2be50f7bd1ceb04f4943a41e039aa107844f16f0 /mailscripts.el | |
parent | c9bc9df07b18b3893e71c322c4670c781d24df29 (diff) | |
download | mailscripts-fa6bbfd2d65f3ec255e92bda30e8112dbe603bfc.tar.gz |
add `ask' value for mailscripts-detach-head-from-existing-branch
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'mailscripts.el')
-rw-r--r-- | mailscripts.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mailscripts.el b/mailscripts.el index 8dc5875..ba4f9da 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -4,7 +4,7 @@ ;; Version: 0.23 ;; Package-Requires: (notmuch) -;; Copyright (C) 2018, 2019, 2020 Sean Whitton +;; Copyright (C) 2018, 2019, 2020, 2022 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 @@ -43,7 +43,9 @@ applying patches before updating any of your existing branches, or for quick, ad hoc testing of a patch series. Note that this does not prevent the creation of new branches." - :type 'boolean + :type '(choice (const :tag "Always detach" t) + (const :tag "Never detach" nil) + (const :tag "Ask whether to detach" ask)) :group 'mailscripts) (defcustom mailscripts-project-library 'projectile @@ -193,7 +195,9 @@ git-format-patch(1)." (defun mailscripts--check-out-branch (branch) (if (string= branch "") - (when mailscripts-detach-head-from-existing-branch + (when (or (eq mailscripts-detach-head-from-existing-branch t) + (and (eq mailscripts-detach-head-from-existing-branch 'ask) + (yes-or-no-p "Detach HEAD before applying patches?"))) (call-process-shell-command "git checkout --detach")) (call-process-shell-command (format "git checkout -b %s" |