Skip to content

Commit

Permalink
diff: Make --diff-merges option available
Browse files Browse the repository at this point in the history
The "separate" and "remerge" values aren't supported yet.

Re #4989.
  • Loading branch information
tarsius committed Sep 12, 2023
1 parent 00ecaab commit 141dd46
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lisp/magit-diff.el
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ and `:slant'."
("-W" "Show surrounding functions" ("-W" "--function-context"))]
["Tune arguments"
(magit-diff:--diff-algorithm)
(magit-diff:--diff-merges)
(magit-diff:-M)
(magit-diff:-C)
(5 "-R" "Reverse sides" "-R")
Expand Down Expand Up @@ -932,6 +933,7 @@ and `:slant'."
("-W" "Show surrounding functions" ("-W" "--function-context"))]
["Tune arguments"
(magit-diff:--diff-algorithm)
(magit-diff:--diff-merges)
(magit-diff:-M)
(magit-diff:-C)
(5 "-R" "Reverse sides" "-R"
Expand Down Expand Up @@ -1021,6 +1023,22 @@ and `:slant'."
(?p "[p]atience" "patience")
(?h "[h]istogram" "histogram")))

(transient-define-argument magit-diff:--diff-merges ()
:description "Diff merges"
:class 'transient-option
:key "-X"
:argument "--diff-merges="
:reader #'magit-diff-select-merges
:always-read t)

(defun magit-diff-select-merges (&rest _ignore)
(magit-read-char-case nil t
(?u "[u]nspecified" nil)
(?o "[o]ff" "off")
(?f "[f]irst-parent" "first-parent")
(?c "[c]ombined" "combined")
(?d "[d]ense-combined" "dense-combined")))

(transient-define-argument magit-diff:--ignore-submodules ()
:description "Ignore submodules"
:class 'transient-option
Expand Down Expand Up @@ -2582,7 +2600,7 @@ Staging and applying changes is documented in info node
(defun magit-insert-revision-diff ()
"Insert the diff into this `magit-revision-mode' buffer."
(magit--insert-diff t
"show" "-p" "--cc" "--format=" "--no-prefix"
"show" "-p" "--format=" "--no-prefix"
(and (member "--stat" magit-buffer-diff-args) "--numstat")
magit-buffer-diff-args
(magit--rev-dereference magit-buffer-revision)
Expand Down

0 comments on commit 141dd46

Please sign in to comment.