aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/RelNotes/3.4.0.org4
-rw-r--r--lisp/magit-commit.el4
-rw-r--r--lisp/magit-git.el13
-rw-r--r--lisp/magit-log.el2
4 files changed, 20 insertions, 3 deletions
diff --git a/docs/RelNotes/3.4.0.org b/docs/RelNotes/3.4.0.org
index 42ea3fa..9169af1 100644
--- a/docs/RelNotes/3.4.0.org
+++ b/docs/RelNotes/3.4.0.org
@@ -174,6 +174,10 @@ b1ad283941 #4526 magit-version: more compatible fix for #4511
- A diff header added in a new Git release wasn't handled yet. #4531
+- Commands that use optional third-party Git extensions didn't
+ consider that extension executables may be installed in Git's exec
+ path instead of a directory in ~exec-path~. #4812
+
- Fixed calculation of gravatar image size. ecfaa325a3
a14f847d97 magit-branch-checkout: Refresh after all configuration took place
diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el
index c852065..03be34b 100644
--- a/lisp/magit-commit.el
+++ b/lisp/magit-commit.el
@@ -463,7 +463,7 @@ See `magit-commit-autofixup' for an alternative implementation."
(transient-args 'magit-commit-absorb))))
(if (eq phase 'transient)
(transient-setup 'magit-commit-absorb)
- (unless (compat-executable-find "git-absorb" t)
+ (unless (magit-git-executable-find "git-absorb")
(user-error "This command requires the git-absorb executable, which %s"
"is available from https://github.com/tummychow/git-absorb"))
(unless (magit-anything-staged-p)
@@ -506,7 +506,7 @@ See `magit-commit-absorb' for an alternative implementation."
(transient-args 'magit-commit-autofixup))))
(if (eq phase 'transient)
(transient-setup 'magit-commit-autofixup)
- (unless (compat-executable-find "git-autofixup" t)
+ (unless (magit-git-executable-find "git-autofixup")
(user-error "This command requires the git-autofixup script, which %s"
"is available from https://github.com/torbiak/git-autofixup"))
(unless (magit-anything-modified-p)
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 641bbc3..502b5f0 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -582,6 +582,19 @@ call function WASHER with ARGS as its sole argument."
(magit-cancel-section))
(magit-maybe-make-margin-overlay))))
+(defun magit-git-executable-find (command)
+ "Search for COMMAND in Git's exec path, falling back to `exec-path'.
+Like `executable-find', return the absolute file name of the
+executable."
+ (or (locate-file command
+ (list (concat
+ (file-remote-p default-directory)
+ (or (magit-git-string "--exec-path")
+ (error "`git --exec-path' failed"))))
+ exec-suffixes
+ #'file-executable-p)
+ (compat-executable-find command t)))
+
;;; Git Version
(defconst magit--git-version-regexp
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index 95290d5..eac0536 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -826,7 +826,7 @@ https://github.com/mhagger/git-when-merged."
(list commit
(magit-read-other-branch "Merged into" commit)))
(magit-log-arguments)))
- (unless (compat-executable-find "git-when-merged" t)
+ (unless (magit-git-executable-find "git-when-merged")
(user-error "This command requires git-when-merged (%s)"
"https://github.com/mhagger/git-when-merged"))
(let (exit m)