aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-06-27 17:11:29 -0400
committerKyle Meyer <kyle@kyleam.com>2020-06-27 17:30:01 -0400
commitafbeea2ac293f794456a4145e1620538d499dc11 (patch)
tree26f7251fa38310ae25e6c991e99ce4cde72f1389
parent9670fc7c845a1523e64f80ac13d76d2717b3d897 (diff)
downloadpiem-afbeea2ac293f794456a4145e1620538d499dc11.tar.gz
piem-am: Move git-am arguments to variable
It's tempting to define a transient for piem-am and let that handle the arguments, but doing so only takes care of the case where piem-am is the entrypoint, not piem-b4-am---which is already a transient with b4 arguments. And it's not yet clear whether many users will need to modify that these arguments across different calls (e.g., based on conventions across different projects). For my purposes, a single set of arguments is fine. For now, add a defvar so that there's at least something to latch onto if someone needs to modify the arguments unconditionally or via a let-binding.
-rw-r--r--piem.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/piem.el b/piem.el
index 145d4aa..6551c82 100644
--- a/piem.el
+++ b/piem.el
@@ -521,6 +521,8 @@ in `piem-default-branch-function'."
(piem--shorten-subject subject)
(and version (concat "__" version))))))
+(defvar piem-am-args (list "--scissors"))
+
;;;###autoload
(defun piem-am (mbox &optional info coderepo)
"Feed an am-ready mbox to `git am'.
@@ -558,9 +560,10 @@ If CODEREPO is given, switch to this directory before calling
(and (not (string-blank-p base))
(list base)))))
(if (bufferp mbox)
- (piem-process-call-with-buffer-input
- nil mbox piem-git-executable "am" "--scissors")
- (piem-process-call nil piem-git-executable "am" "--scissors" mbox))
+ (apply #'piem-process-call-with-buffer-input
+ nil mbox piem-git-executable "am" piem-am-args)
+ (apply #'piem-process-call nil piem-git-executable "am"
+ (append piem-am-args (list mbox))))
(if (and piem-use-magit
(fboundp 'magit-status-setup-buffer))
(magit-status-setup-buffer)