New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forbidden reentrant call of Tramp when creating a signed commit #5006
Comments
Hallo Justus! I am by no means a Tramp expert, since I pretty much only use it to debug issues other people are having when using Magit over Tramp. ;) Because I was planning to do another round of that next week anyway, your timing couldn't be much better. Turns out though, that the server I was going to use for testing, is completely borked, so that is a bit of a setback. But actually, I think we might be able to solve this one, before I get my other box up and running again.
Just to make sure, the created commit is signed, right?
So the agent already has the decrypted key, right? If those are two ayes, my initial guess that is has something to do with issues when the agent is trying to obtain the passphrase, obviously is out of the window. Which is probably for the better.
That uncaching is not essential. Reading up a bit on Tramp, I have learned that it cannot run more than one processes per connection at once, and since the call to So, please try with the call to If that works, and I have high hopes it will, I'll change this so |
Hm, and I should look into making this optional even locally. It's used a lot and is potentially horrible for performance when dealing with large directories and/or on Windows. Having to manually refresh Dired buffers on demand, doesn't seem like a big deal in comparison. |
Hey Jonas :)
> With Magit from git, the commit *is* created,
Just to make sure, the created commit is signed, right?
Aye.
> On a remote system, create a git repository, enable commit signing,
> and setup GnuPG so that it has a key to sign with. Check that
> creating a signed commit works. Then, visit a file in that repository
> via Tramp, change it, and try to create a commit using Magit.
So the agent already has the decrypted key, right?
Aye!
If those are two ayes, my initial guess that is has something to do
with issues when the agent is trying to obtain the passphrase,
obviously is out of the window. Which is probably for the better.
Indeed.
> ```
> Debugger entered--Lisp error: (remote-file-error "Forbidden reentrant call of Tramp")
> [...]
> (progn (dired-uncache default-dir))
> [...]
> ```
That uncaching is not essential.
Reading up a bit on Tramp, I have learned that it cannot run more than
one processes per connection at once, and since the call to
`dired-uncache` is in a process sentinal and is going to start
sub-processes, that is bound to become an issue. Looking through the
history of the use of this function, I learned that many years ago we
tried to protect against that, but apparently that got lost at some
point.
So, please try with the call to `dired-uncache` removed. (Don't
forget to `M-x eval-defun`, after making the edit.)
For the record, I did the following change:
```diff
diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index 53df804a..f458212d 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -1155,8 +1155,8 @@ Limited by `magit-process-error-tooltip-max-lines'."
(setq default-dir (process-get arg 'default-dir))
(setq section (process-get arg 'section))
(setq arg (process-exit-status arg)))
- (when (fboundp 'dired-uncache)
- (dired-uncache default-dir))
+ ;; (when (fboundp 'dired-uncache)
+ ;; (dired-uncache default-dir))
(when (buffer-live-p process-buf)
(with-current-buffer process-buf
(let ((inhibit-read-only t)
```
If that works, and I have high hopes it will, I'll change this so `dired-uncache` is only called if `(file-remote-p default-dir)` returns nil.
It still throws the error, but the uncache is gone:
```
Debugger entered--Lisp error: (remote-file-error "Forbidden reentrant call of Tramp")
signal(remote-file-error ("Forbidden reentrant call of Tramp"))
tramp-error(#<process *tramp/ssh europ.nat*> remote-file-error "Forbidden reentrant call of Tramp")
tramp-send-string((tramp-file-name "ssh" nil nil "europ.nat" nil "/tmp/a-test-repo" nil) "test -d /tmp/a-test-repo 2>/dev/null; echo tramp_e...")
tramp-send-command((tramp-file-name "ssh" nil nil "europ.nat" nil "/tmp/a-test-repo" nil) "test -d /tmp/a-test-repo 2>/dev/null; echo tramp_e...")
tramp-send-command-and-check((tramp-file-name "ssh" nil nil "europ.nat" nil "/tmp/a-test-repo" nil) "test -d /tmp/a-test-repo")
tramp-run-test("-d" "/ssh:europ.nat:/tmp/a-test-repo")
tramp-sh-handle-file-directory-p("/ssh:europ.nat:/tmp/a-test-repo")
tramp-sh-file-name-handler(file-directory-p "/ssh:europ.nat:/tmp/a-test-repo")
apply(tramp-sh-file-name-handler file-directory-p "/ssh:europ.nat:/tmp/a-test-repo")
tramp-file-name-handler(file-directory-p "/ssh:europ.nat:/tmp/a-test-repo")
file-directory-p("/ssh:europ.nat:/tmp/a-test-repo/")
(and (file-directory-p filename) (file-accessible-directory-p filename))
magit-file-accessible-directory-p("/ssh:europ.nat:/tmp/a-test-repo/")
(not (magit-file-accessible-directory-p dir))
(while (not (magit-file-accessible-directory-p dir)) (setq dir (file-name-directory (directory-file-name dir))) (if (equal dir previous) (progn (throw 'unsafe-default-dir nil))) (setq previous dir))
(let ((dir (file-name-as-directory (expand-file-name (or file default-directory)))) (previous nil)) (while (not (magit-file-accessible-directory-p dir)) (setq dir (file-name-directory (directory-file-name dir))) (if (equal dir previous) (progn (throw 'unsafe-default-dir nil))) (setq previous dir)) dir)
(catch 'unsafe-default-dir (let ((dir (file-name-as-directory (expand-file-name (or file default-directory)))) (previous nil)) (while (not (magit-file-accessible-directory-p dir)) (setq dir (file-name-directory (directory-file-name dir))) (if (equal dir previous) (progn (throw 'unsafe-default-dir nil))) (setq previous dir)) dir))
magit--safe-default-directory(nil)
(and t (magit--safe-default-directory directory))
(let* ((default-directory (and t (magit--safe-default-directory directory)))) (if default-directory (let* ((topdir (and t (magit-rev-parse-safe "--show-toplevel")))) (if topdir (let (updir) (setq topdir (magit-expand-git-file-name topdir)) (cond ((and ... ... ...) updir) ((concat ... ...)))) (let* ((gitdir (and t ...)) (gitdir (and gitdir ...))) (if gitdir (progn (if ... gitdir ...)))))) nil))
(if magit--refresh-cache (let ((G35 (cons (or directory default-directory) 'magit-toplevel))) (let* ((G36 (and t (assoc G35 (cdr magit--refresh-cache))))) (if G36 (progn (let* ((v magit--refresh-cache)) (setcar (car v) (+ ... 1))) (cdr G36)) (progn (let* ((v magit--refresh-cache)) (setcdr (car v) (+ ... 1))) (let ((value ...)) (let* (... ...) (setcdr v ...)) value))))) (let* ((default-directory (and t (magit--safe-default-directory directory)))) (if default-directory (let* ((topdir (and t (magit-rev-parse-safe "--show-toplevel")))) (if topdir (let (updir) (setq topdir (magit-expand-git-file-name topdir)) (cond (... updir) (...))) (let* ((gitdir ...) (gitdir ...)) (if gitdir (progn ...))))) nil)))
(or (if magit--refresh-cache (let ((G35 (cons (or directory default-directory) 'magit-toplevel))) (let* ((G36 (and t (assoc G35 ...)))) (if G36 (progn (let* (...) (setcar ... ...)) (cdr G36)) (progn (let* (...) (setcdr ... ...)) (let (...) (let* ... ...) value))))) (let* ((default-directory (and t (magit--safe-default-directory directory)))) (if default-directory (let* ((topdir (and t ...))) (if topdir (let (updir) (setq topdir ...) (cond ... ...)) (let* (... ...) (if gitdir ...)))) nil))))
magit-toplevel()
(let ((topdir (magit-toplevel))) (if topdir nil (let* ((default-directory (and t (magit--safe-default-directory nil)))) (if default-directory (progn (setq topdir default-directory) (let (prev) (while (not ...) (setq prev topdir) (setq topdir ...)))) nil))) (let ((buffer (or (let (needle) (let (... ... elt) (while ... ... ...)) needle) (magit-generate-new-buffer 'magit-process-mode nil topdir)))) (save-current-buffer (set-buffer buffer) (if magit-root-section (if magit-process-log-max (progn (magit-process-truncate-log))) (magit-process-mode) (let ((inhibit-read-only t) (magit-insert-section--parent nil) (magit-insert-section--oldroot nil)) (make-local-variable 'text-property-default-nonsticky) (let* ((type47 ...) (section48 ...)) (eieio-oset section48 'hidden (let* ... ...)) (let (... ... ...) (catch ... ... ... ... ... ... ...) (if magit-section-insert-in-reverse ...) section48))))) (if nodisplay nil (magit-display-buffer buffer)) buffer))
magit-process-buffer(t)
(let ((buf (magit-process-buffer t))) (if (and (= arg 0) (not (and (let (needle) (let (... ... elt) (while ... ... ...)) needle) t))) (progn (magit-section-hide section))))
(if (= (eieio-oref section 'end) (+ (line-end-position) 2)) (save-excursion (goto-char (1+ (line-end-position))) (delete-char -1) (eieio-oset section 'content nil)) (let ((buf (magit-process-buffer t))) (if (and (= arg 0) (not (and (let (needle) (let ... ...) needle) t))) (progn (magit-section-hide section)))))
(let ((inhibit-read-only t) (marker (eieio-oref section 'start))) (goto-char marker) (save-excursion (delete-char 3) (set-marker-insertion-type marker nil) (insert (propertize (format "%3s" arg) 'magit-section section 'font-lock-face (if (= arg 0) 'magit-process-ok 'magit-process-ng))) (set-marker-insertion-type marker t)) (if magit-process-finish-apply-ansi-colors (progn (ansi-color-apply-on-region (eieio-oref section 'content) (eieio-oref section 'end)))) (if (= (eieio-oref section 'end) (+ (line-end-position) 2)) (save-excursion (goto-char (1+ (line-end-position))) (delete-char -1) (eieio-oset section 'content nil)) (let ((buf (magit-process-buffer t))) (if (and (= arg 0) (not (and (let ... ... needle) t))) (progn (magit-section-hide section))))))
(save-current-buffer (set-buffer process-buf) (let ((inhibit-read-only t) (marker (eieio-oref section 'start))) (goto-char marker) (save-excursion (delete-char 3) (set-marker-insertion-type marker nil) (insert (propertize (format "%3s" arg) 'magit-section section 'font-lock-face (if (= arg 0) 'magit-process-ok 'magit-process-ng))) (set-marker-insertion-type marker t)) (if magit-process-finish-apply-ansi-colors (progn (ansi-color-apply-on-region (eieio-oref section 'content) (eieio-oref section 'end)))) (if (= (eieio-oref section 'end) (+ (line-end-position) 2)) (save-excursion (goto-char (1+ (line-end-position))) (delete-char -1) (eieio-oset section 'content nil)) (let ((buf (magit-process-buffer t))) (if (and (= arg 0) (not (and ... t))) (progn (magit-section-hide section)))))))
(progn (save-current-buffer (set-buffer process-buf) (let ((inhibit-read-only t) (marker (eieio-oref section 'start))) (goto-char marker) (save-excursion (delete-char 3) (set-marker-insertion-type marker nil) (insert (propertize (format "%3s" arg) 'magit-section section 'font-lock-face (if (= arg 0) 'magit-process-ok 'magit-process-ng))) (set-marker-insertion-type marker t)) (if magit-process-finish-apply-ansi-colors (progn (ansi-color-apply-on-region (eieio-oref section 'content) (eieio-oref section 'end)))) (if (= (eieio-oref section 'end) (+ (line-end-position) 2)) (save-excursion (goto-char (1+ (line-end-position))) (delete-char -1) (eieio-oset section 'content nil)) (let ((buf (magit-process-buffer t))) (if (and (= arg 0) (not ...)) (progn (magit-section-hide section))))))))
(if (buffer-live-p process-buf) (progn (save-current-buffer (set-buffer process-buf) (let ((inhibit-read-only t) (marker (eieio-oref section 'start))) (goto-char marker) (save-excursion (delete-char 3) (set-marker-insertion-type marker nil) (insert (propertize (format "%3s" arg) 'magit-section section 'font-lock-face (if ... ... ...))) (set-marker-insertion-type marker t)) (if magit-process-finish-apply-ansi-colors (progn (ansi-color-apply-on-region (eieio-oref section ...) (eieio-oref section ...)))) (if (= (eieio-oref section 'end) (+ (line-end-position) 2)) (save-excursion (goto-char (1+ ...)) (delete-char -1) (eieio-oset section 'content nil)) (let ((buf ...)) (if (and ... ...) (progn ...))))))))
magit-process-finish(#<process git>)
(progn (setq event (substring event 0 -1)) (if (string-match "^finished" event) (progn (message (concat (capitalize (process-name process)) " finished")))) (magit-process-finish process) (if (eq process magit-this-process) (progn (setq magit-this-process nil))) (if (process-get process 'inhibit-refresh) nil (let ((command-buf (process-get process 'command-buf))) (if (buffer-live-p command-buf) (save-current-buffer (set-buffer command-buf) (magit-refresh)) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ...) (and ... ...))))))))
(if (memq (process-status process) '(exit signal)) (progn (setq event (substring event 0 -1)) (if (string-match "^finished" event) (progn (message (concat (capitalize (process-name process)) " finished")))) (magit-process-finish process) (if (eq process magit-this-process) (progn (setq magit-this-process nil))) (if (process-get process 'inhibit-refresh) nil (let ((command-buf (process-get process 'command-buf))) (if (buffer-live-p command-buf) (save-current-buffer (set-buffer command-buf) (magit-refresh)) (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))))))))
magit-process-sentinel(#<process git> "finished\n")
accept-process-output(#<process *tramp/ssh europ.nat*> nil nil t)
tramp-accept-process-output(#<process *tramp/ssh europ.nat*>)
tramp-wait-for-regexp(#<process *tramp/ssh europ.nat*> nil "\\(^\\|\0\\)[^#$\n]*///0c705e19c85cea87304133560ac40b2f...")
tramp-wait-for-output(#<process *tramp/ssh europ.nat*>)
tramp-send-command((tramp-file-name "ssh" nil nil "europ.nat" nil "/tmp/a-test-repo/.git/" nil) "( cd /tmp/a-test-repo/.git/ && env INSIDE_EMACS\\=2...")
tramp-send-command-and-check((tramp-file-name "ssh" nil nil "europ.nat" nil "/tmp/a-test-repo/.git/" nil) "cd /tmp/a-test-repo/.git/ && env INSIDE_EMACS\\=28...." t t t)
#<subr tramp-sh-handle-process-file>("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel")
apply(#<subr tramp-sh-handle-process-file> "git" nil (t nil) nil ("--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel"))
(if magit-tramp-process-environment (apply fn "env" infile destination display (append magit-tramp-process-environment (cons program args))) (apply fn program infile destination display args))
tramp-sh-handle-process-file--magit-tramp-process-environment(#<subr tramp-sh-handle-process-file> "git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel")
apply(tramp-sh-handle-process-file--magit-tramp-process-environment #<subr tramp-sh-handle-process-file> ("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel"))
tramp-sh-handle-process-file("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel")
tramp-sh-file-name-handler(process-file "git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel")
apply(tramp-sh-file-name-handler process-file ("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel"))
tramp-file-name-handler(process-file "git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel")
process-file("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel")
apply(process-file "git" nil (t nil) nil ("--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel"))
(let ((process-environment (magit-process-environment)) (default-process-coding-system (magit--process-coding-system))) (apply #'process-file process infile buffer display args))
magit-process-file("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel")
apply(magit-process-file "git" nil (t nil) nil ("--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false" "rev-parse" "--show-toplevel"))
magit-process-git((t nil) ("rev-parse" "--show-toplevel"))
(progn (set (make-local-variable 'process-environment) G11) (magit-process-git (list t nil) args) (if (bobp) nil (goto-char (point-min)) (buffer-substring-no-properties (point) (line-end-position))))
(unwind-protect (progn (set (make-local-variable 'process-environment) G11) (magit-process-git (list t nil) args) (if (bobp) nil (goto-char (point-min)) (buffer-substring-no-properties (point) (line-end-position)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set (make-local-variable 'process-environment) G11) (magit-process-git (list t nil) args) (if (bobp) nil (goto-char (point-min)) (buffer-substring-no-properties (point) (line-end-position)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set (make-local-variable 'process-environment) G11) (magit-process-git (list t nil) args) (if (bobp) nil (goto-char (point-min)) (buffer-substring-no-properties (point) (line-end-position)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
(let ((G11 process-environment)) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set (make-local-variable 'process-environment) G11) (magit-process-git (list t nil) args) (if (bobp) nil (goto-char (point-min)) (buffer-substring-no-properties (point) (line-end-position)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
(if magit--refresh-cache (let ((G8 (cons default-directory args))) (let* ((G9 (and t (assoc G8 (cdr magit--refresh-cache))))) (if G9 (progn (let* ((v magit--refresh-cache)) (setcar (car v) (+ ... 1))) (cdr G9)) (progn (let* ((v magit--refresh-cache)) (setcdr (car v) (+ ... 1))) (let ((value ...)) (let* (... ...) (setcdr v ...)) value))))) (let ((G11 process-environment)) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set (make-local-variable ...) G11) (magit-process-git (list t nil) args) (if (bobp) nil (goto-char ...) (buffer-substring-no-properties ... ...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))
magit-git-str("rev-parse" "--show-toplevel")
apply(magit-git-str "rev-parse" "--show-toplevel")
magit-rev-parse-safe("--show-toplevel")
(and t (magit-rev-parse-safe "--show-toplevel"))
(let* ((topdir (and t (magit-rev-parse-safe "--show-toplevel")))) (if topdir (let (updir) (setq topdir (magit-expand-git-file-name topdir)) (cond ((and (not find-file-visit-truename) (not (getenv "GIT_WORK_TREE")) (progn (setq updir ...) (setq updir ...) (let* ... ...))) updir) ((concat (file-remote-p default-directory) (file-name-as-directory topdir))))) (let* ((gitdir (and t (magit-rev-parse-safe "--git-dir"))) (gitdir (and gitdir (file-name-as-directory (if ... ... ...))))) (if gitdir (progn (if (magit-bare-repo-p) gitdir (let* (... ...) (cond ... ... ...))))))))
(if default-directory (let* ((topdir (and t (magit-rev-parse-safe "--show-toplevel")))) (if topdir (let (updir) (setq topdir (magit-expand-git-file-name topdir)) (cond ((and (not find-file-visit-truename) (not ...) (progn ... ... ...)) updir) ((concat (file-remote-p default-directory) (file-name-as-directory topdir))))) (let* ((gitdir (and t (magit-rev-parse-safe "--git-dir"))) (gitdir (and gitdir (file-name-as-directory ...)))) (if gitdir (progn (if (magit-bare-repo-p) gitdir (let* ... ...))))))) nil)
(let* ((default-directory (and t (magit--safe-default-directory directory)))) (if default-directory (let* ((topdir (and t (magit-rev-parse-safe "--show-toplevel")))) (if topdir (let (updir) (setq topdir (magit-expand-git-file-name topdir)) (cond ((and ... ... ...) updir) ((concat ... ...)))) (let* ((gitdir (and t ...)) (gitdir (and gitdir ...))) (if gitdir (progn (if ... gitdir ...)))))) nil))
(if magit--refresh-cache (let ((G35 (cons (or directory default-directory) 'magit-toplevel))) (let* ((G36 (and t (assoc G35 (cdr magit--refresh-cache))))) (if G36 (progn (let* ((v magit--refresh-cache)) (setcar (car v) (+ ... 1))) (cdr G36)) (progn (let* ((v magit--refresh-cache)) (setcdr (car v) (+ ... 1))) (let ((value ...)) (let* (... ...) (setcdr v ...)) value))))) (let* ((default-directory (and t (magit--safe-default-directory directory)))) (if default-directory (let* ((topdir (and t (magit-rev-parse-safe "--show-toplevel")))) (if topdir (let (updir) (setq topdir (magit-expand-git-file-name topdir)) (cond (... updir) (...))) (let* ((gitdir ...) (gitdir ...)) (if gitdir (progn ...))))) nil)))
(or (if magit--refresh-cache (let ((G35 (cons (or directory default-directory) 'magit-toplevel))) (let* ((G36 (and t (assoc G35 ...)))) (if G36 (progn (let* (...) (setcar ... ...)) (cdr G36)) (progn (let* (...) (setcdr ... ...)) (let (...) (let* ... ...) value))))) (let* ((default-directory (and t (magit--safe-default-directory directory)))) (if default-directory (let* ((topdir (and t ...))) (if topdir (let (updir) (setq topdir ...) (cond ... ...)) (let* (... ...) (if gitdir ...)))) nil))))
magit-toplevel()
(or (and (boundp 'magit--default-directory) magit--default-directory) (magit-toplevel))
magit-repository-local-repository()
(or repository (magit-repository-local-repository))
(assoc (or repository (magit-repository-local-repository)) magit-repository-local-cache)
(and t (assoc (or repository (magit-repository-local-repository)) magit-repository-local-cache))
(let* ((cache (and t (assoc (or repository (magit-repository-local-repository)) magit-repository-local-cache)))) (if cache (setq cache (assoc-delete-all key cache)) nil))
magit-repository-local-delete(this-commit-command)
magit-commit--reset-command()
with-editor-finish(nil)
funcall-interactively(with-editor-finish nil)
command-execute(with-editor-finish)
```
|
The call to You still need to remove the call to I still don't understand why signing a commit would trigger this issue. You could try updating Tramp from GNU ELPA, on the off chance that this is causes by a Tramp bug that has already been fixed. |
It seems it's still the case with latest master of emacs(tramp) and magit. |
I too get forbidden reentrant calls with a similar setup. @kohnish using something like keychain that spawns gpg-agent and loads your keys and provides shell scripts to read in your gpg and ssh environment. there is a corresponding emacs package keychain-environment for better integration. with such a setup, i can use commit signing without any annoyances. |
When visiting a remote file over Tramp, Magit should create a commit without any issues when the remote git has commit signing turned on (commit.gpgsign = true), and the remote system has the required key material and GnuPG setup to create the signature.
Magit from Debian Bookworm (2.99.0.git0957.ge8c7bd03-1) fails to create a commit at all. No error is displayed in the minibuffer or magit log buffer. The changes are still staged.
I then installed magit from git, and started it using
make emacs-Q
, loaded Tramp, increased Tramp's verbosity to 6, enabled trapping into the debugger using(setq debug-on-error t debug-on-signal t)
, and reproduced the issue. With Magit from git, the commit is created, but due to the error shown below, Magit's status buffer is not refreshed.Magit version: Magit v3.3.0-757-g7a1d5034, Transient 0.4.3, Git 2.39.2, Emacs 28.2, gnu/linux
Stack trace:
Tramp debug log:
On a remote system, create a git repository, enable commit signing, and setup GnuPG so that it has a key to sign with. Check that creating a signed commit works. Then, visit a file in that repository via Tramp, change it, and try to create a commit using Magit.
The text was updated successfully, but these errors were encountered: