branch: elpa/magit
commit 987caa41c85d6715134c48c3d2e0b9da2364c475
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-bisect-start--assert: Only insist on merge-base
    
    Git no longer requires the good commit to be an ancestor of the
    bad commit.  If it is not, then their merge-base is used as the
    good commit.  So check if there is a merge base.
    
    Closes #5238.
---
 docs/CHANGELOG.4     | 4 ++++
 lisp/magit-bisect.el | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/docs/CHANGELOG.4 b/docs/CHANGELOG.4
index 24797fac4c..ed25cf1d02 100644
--- a/docs/CHANGELOG.4
+++ b/docs/CHANGELOG.4
@@ -53,6 +53,10 @@ Bugfixes:
 
 - Fixed regressions in ~magit-ediff-resolve-rest~.  #5603
 
+- ~magit-bisect-start~ and ~magit-bisect-run~ insisted on the good commit
+  being an ancestor of the bad, but ~git bisect~ only requires a merge-
+  base.  #5238
+
 * v4.6.0    2026-07-01
 
 The primary focus of this release are blob-visiting buffers.  For
diff --git a/lisp/magit-bisect.el b/lisp/magit-bisect.el
index 8b11cf335a..6cc646741a 100644
--- a/lisp/magit-bisect.el
+++ b/lisp/magit-bisect.el
@@ -120,10 +120,10 @@ other actions from the bisect transient command (\
           args)))
 
 (defun magit-bisect-start--assert (bad good args)
-  (unless (magit-rev-ancestor-p good bad)
+  (unless (magit-git-string "merge-base" bad good)
     (user-error
-     "The %s revision (%s) has to be an ancestor of the %s one (%s)"
-     (or (transient-arg-value "--term-old=" args) "good")
+     "%s `%s' or merge-base has to be an ancestor of %s `%s')"
+     (or (transient-arg-value "--term-old=" args) "Good")
      good
      (or (transient-arg-value "--term-new=" args) "bad")
      bad))

Reply via email to