emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit 141dd46798 6/6: diff: Make --diff-merges option


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 141dd46798 6/6: diff: Make --diff-merges option available
Date: Tue, 12 Sep 2023 18:59:31 -0400 (EDT)

branch: elpa/git-commit
commit 141dd46798e5cae57617e941418ebbb3a2172f5e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    diff: Make --diff-merges option available
    
    The "separate" and "remerge" values aren't supported yet.
    
    Re #4989.
---
 lisp/magit-diff.el | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index b7fdc82705..cedba6a80e 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -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")
@@ -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"
@@ -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
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]