summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-01-07 14:22:53 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-01-07 14:39:45 -0700
commitfa6bbfd2d65f3ec255e92bda30e8112dbe603bfc (patch)
tree2be50f7bd1ceb04f4943a41e039aa107844f16f0
parentc9bc9df07b18b3893e71c322c4670c781d24df29 (diff)
downloadmailscripts-fa6bbfd2d65f3ec255e92bda30e8112dbe603bfc.tar.gz
add `ask' value for mailscripts-detach-head-from-existing-branch
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--debian/changelog7
-rw-r--r--mailscripts.el10
2 files changed, 14 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index 947cbcb..69c65ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mailscripts (0.24-1) UNRELEASED; urgency=medium
+
+ * mailscripts.el:
+ - mailscripts-detach-head-from-existing-branch can now have value `ask'.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Fri, 07 Jan 2022 14:21:25 -0700
+
mailscripts (0.23-1) unstable; urgency=medium
* New script: gmi2email
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"