aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2019-01-26 00:35:06 +0100
committerJonas Bernoulli <jonas@bernoul.li>2019-02-14 20:17:36 +0100
commit139dfe86c16bb6c8a2cc012708c139adae2424e7 (patch)
treeafb5db9a013a5fa7222fd048407d36a3a6502cdc
parent5257225bda20016a2491c8159890ad4f27b25370 (diff)
magit-{merge,notes}:--strategy: Define options explicitly
-rw-r--r--lisp/magit-merge.el11
-rw-r--r--lisp/magit-notes.el10
-rw-r--r--lisp/magit-sequence.el4
3 files changed, 21 insertions, 4 deletions
diff --git a/lisp/magit-merge.el b/lisp/magit-merge.el
index ad4e4f5..b216538 100644
--- a/lisp/magit-merge.el
+++ b/lisp/magit-merge.el
@@ -44,7 +44,7 @@
:if-not magit-merge-in-progress-p
("-f" "Fast-forward only" "--ff-only")
("-n" "No fast-forward" "--no-ff")
- ("=s" "Strategy" "--strategy=")]
+ (magit-merge:--strategy)]
["Actions"
:if-not magit-merge-in-progress-p
[("m" "Merge" magit-merge-plain)
@@ -63,6 +63,15 @@
(defun magit-merge-arguments ()
(transient-args 'magit-merge))
+(define-infix-argument magit-merge:--strategy ()
+ :description "Strategy"
+ :class 'transient-option
+ :key "=s"
+ ;; shortarg for merge: "-s"
+ ;; shortarg for cherry-pick and revert: none
+ :argument "--strategy="
+ :choices '("resolve" "recursive" "octopus" "ours" "subtree"))
+
;;;###autoload
(defun magit-merge-plain (rev &optional args nocommit)
"Merge commit REV into the current branch; using default message.
diff --git a/lisp/magit-notes.el b/lisp/magit-notes.el
index 345b71b..673160d 100644
--- a/lisp/magit-notes.el
+++ b/lisp/magit-notes.el
@@ -49,7 +49,7 @@
("=r" "Manipulate ref" "--ref=" magit-notes-read-ref)]
["Arguments for merge"
:if-not magit-notes-merging-p
- ("=s" "Merge strategy" "--strategy=")]
+ (magit-notes:--strategy)]
["Actions"
:if-not magit-notes-merging-p
("T" "Edit" magit-notes-edit)
@@ -92,6 +92,14 @@
:reader 'magit-notes-read-refs
:prompt "Set global notes.displayRef")
+(define-infix-argument magit-notes:--strategy ()
+ :description "Merge strategy"
+ :class 'transient-option
+ :key "=s"
+ :shortarg "-s"
+ :argument "--strategy="
+ :choices '("manual" "ours" "theirs" "union" "cat_sort_uniq"))
+
(defun magit-notes-edit (commit &optional ref)
"Edit the note attached to COMMIT.
REF is the notes ref used to store the notes.
diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el
index 4c23731..7ed2da0 100644
--- a/lisp/magit-sequence.el
+++ b/lisp/magit-sequence.el
@@ -131,7 +131,7 @@ This discards all changes made since the sequence started."
:if-not magit-sequencer-in-progress-p
("-F" "Attempt fast-forward" "--ff")
("=m" "Replay merge relative to parent" "--mainline=")
- ("=s" "Strategy" "--strategy=")
+ ("=s" magit-merge:--strategy)
("-e" "Edit commit messages" ("-e" "--edit"))
("-x" "Reference cherry in commit message" "-x")
("-s" "Add Signed-off-by lines" ("-s" "--signoff"))]
@@ -342,7 +342,7 @@ the process manually."
("=m" "Replay merge relative to parent" "--mainline=")
("-e" "Edit commit message" ("-e" "--edit"))
("-E" "Don't edit commit message" "--no-edit")
- ("=s" "Strategy" "--strategy=")
+ ("=s" magit-merge:--strategy)
("-s" "Add Signed-off-by lines" ("-s" "--signoff"))
(magit:--gpg-sign)]
["Actions"