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

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

[nongnu] elpa/git-commit 5a7519fd3d 9/9: magit-ediff-dwim-resolve-functi


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 5a7519fd3d 9/9: magit-ediff-dwim-resolve-function: New option
Date: Mon, 16 May 2022 16:58:17 -0400 (EDT)

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

    magit-ediff-dwim-resolve-function: New option
---
 docs/magit.org      |  6 ++++++
 docs/magit.texi     |  6 ++++++
 lisp/magit-ediff.el | 10 +++++++++-
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/docs/magit.org b/docs/magit.org
index 715703839d..062ebe82c8 100644
--- a/docs/magit.org
+++ b/docs/magit.org
@@ -3577,6 +3577,12 @@ information on how to use Ediff itself, see info:ediff.
 
   Show changes to a file introduced by a stash using Ediff.
 
+- User Option: magit-ediff-dwim-resolve-function ::
+
+  This option controls which function ~magit-ediff-dwim~ uses to resolve
+  conflicts.  One of ~magit-ediff-resolve-rest~, ~magit-ediff-resolve-all~
+  or ~magit-git-mergetool~; which are all discussed above.
+
 - User Option: magit-ediff-dwim-show-on-hunks ::
 
   This option controls what command ~magit-ediff-dwim~ calls when
diff --git a/docs/magit.texi b/docs/magit.texi
index 6823540237..f383df6553 100644
--- a/docs/magit.texi
+++ b/docs/magit.texi
@@ -4456,6 +4456,12 @@ Show changes to a file introduced by a commit using 
Ediff.
 Show changes to a file introduced by a stash using Ediff.
 @end table
 
+@defopt magit-ediff-dwim-resolve-function
+This option controls which function @code{magit-ediff-dwim} uses to resolve
+conflicts.  One of @code{magit-ediff-resolve-rest}, 
@code{magit-ediff-resolve-all}
+or @code{magit-git-mergetool}; which are all discussed above.
+@end defopt
+
 @defopt magit-ediff-dwim-show-on-hunks
 This option controls what command @code{magit-ediff-dwim} calls when
 point is on uncommitted hunks.  When nil, always run
diff --git a/lisp/magit-ediff.el b/lisp/magit-ediff.el
index 7672327603..ac9129d4b4 100644
--- a/lisp/magit-ediff.el
+++ b/lisp/magit-ediff.el
@@ -56,6 +56,14 @@ invoked using Magit."
   :options '(magit-ediff-cleanup-auxiliary-buffers
              magit-ediff-restore-previous-winconf))
 
+(defcustom magit-ediff-dwim-resolve-function #'magit-ediff-resolve-rest
+  "The function `magit-ediff-dwim' uses to resolve conflicts."
+  :package-version '(magit . "3.4.0")
+  :group 'magit-ediff
+  :type '(choice (const magit-ediff-resolve-rest)
+                 (const magit-ediff-resolve-all)
+                 (const magit-git-mergetool)))
+
 (defcustom magit-ediff-dwim-show-on-hunks nil
   "Whether `magit-ediff-dwim' runs show variants on hunks.
 If non-nil, `magit-ediff-show-staged' or
@@ -427,7 +435,7 @@ mind at all, then it asks the user for a command to run."
          ((and (guard (not magit-ediff-dwim-show-on-hunks))
                (or 'unstaged 'staged))
           (setq command (if (magit-anything-unmerged-p)
-                            #'magit-ediff-resolve-rest
+                            magit-ediff-dwim-resolve-function
                           #'magit-ediff-stage)))
          ('unstaged (setq command #'magit-ediff-show-unstaged))
          ('staged (setq command #'magit-ediff-show-staged))



reply via email to

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