1

I installed magit. I added the following lines to my .emacs:

(require 'tramp)
(push "/path/to/git/directory/" tramp-remote-path)

And when I am in tramp I run M-x magit-version here is the output:

Magit 20170808.1712, Git (unknown), Emacs 25.2.1, darwin

So despite being pointed at the right git it definitely isn't finding it. I checked magit-git-executable and it is "git" and the correct path is at the start of tramp-remote-path.

Time for option #2. I changed my .emacs, removing the previous two lines and adding this:

(setq magit-git-executable "/path/to/git/directory/git")

Now I can get magit to show the correct git version, I can open magit-status. But now I get

"Error in post-command-hook (magit-auto-revert-mode-check-buffers): (file-error "Searching for program" "No such file or directory" "/path/to/git/directory/git")

no matter what I do. I cannot switch buffers, I cannot close buffers, I cannot exit. I am forced to do a force quit from the OS.

Questions:

  • Why doesn't tramp-remote-path work at all?
  • Why does setting magit-git-executable screw things up so bad I can't even exit Emacs normally?
  • Why is it so hard to get Emacs, git, tramp and magit to play nice together?
  • What am I doing wrong?
  • No. Not literally. The path doesn't matter other than to note that the path I used in tramp-remote-path was the same path (with "git" appended) that I used with magit-git-executable. – gbz Aug 22 '17 at 20:43
  • OP, TRAMP can cache stale path information. See emacs.stackexchange.com/questions/47345/…. – Norman Ramsey Jan 26 at 15:42
2

I don't believe that stackexchange is the best medium to solve your problem. It needs debugging. I recommend you send your problem to both the Tramp mailing list tramp-devel@gnu.org and the Magit mailing list (don't know the address) as one message.

Answering your questions:

  • Why doesn't tramp-remote-path work at all?

    This needs debugging. Set tramp-verbose to 6, rerun your test, and show the resulting Tramp debug buffer (not here, at the Tramp mailing list).

  • Why does setting magit-git-executable screw things up so bad I can't even exit Emacs normally?

    Don't know, I'm not using Magit.

  • Why is it so hard to get Emacs, git, tramp and magit to play nice together?

    Well, Tramp and Magit are different packages. You must bring us together, as you have done with your question.

  • What am I doing wrong?

    Let's see ...

Michael Albinus, Tramp maintainer

  • Okay. Thanks for pointing me in the right direction. I'll send off some e-mails per your recommendation. – gbz Aug 23 '17 at 15:14
0

I think I fixed this issue on my own machine with:

(add-to-list 'tramp-remote-path "/path/to/git/on/remote/machine")
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.