Re: sshfs + magit + gopls

Joel Reicher <[email protected]> Thu, 09 Apr 2026 08:01:17 +1000
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
"Patrick Ohly" <[email protected]> writes:

> I am using Tramp over ssh to do remote development in Go. This=20
> works reasonably well with gopls, thanks to everyone who has=20
> made this possible!  Magit tends to be slow, so I gave up trying=20
> to use it.

I think you have asked a few unrelated things here, so I'm just=20
going to answer everything as best I can (full disclaimer: I'm not=20
expert in some of this).

I've heard magit makes excessive calls to git because git is=20
supposed to be cheap. I believe that cannot be understated: in my=20
opinion working with a remote git repo is a serious abuse of=20
git. It is designed to fetch everything from the remote to a local=20
copy, and all operations that would be expensive done on a remote=20
location become cheap(er) done locally. This is fundamental to=20
git's design, and remains true even if you run the code remotely.

Just my opinion.

> With the hope of improving performance, I tried out sshfs. I ran=20
> into some shortcomings (bugs?) compared to ssh. If this is not=20
> the right place to report those then please ignore. I'm not=20
> subscribed to the list, please group-reply. But I can also=20
> subscribe, it that's required or preferred.

If the bugs are with the TRAMP's sshfs method, this is the right=20
place. If it's with sshfs itself, it's not.

> I am using Emacs 30.1 with Tramp 2.8.1.3, go-mode 20250311.156,=20
> magit 20260401.2251 (all packages updated via elpa=20
> yesterday). gopls is installed in /usr/local/bin on the remote=20
> host.
>
> When I open a Go file, *Warnings* opens and I get:
>    =E2=9B=94 Warning (tramp): STDERR not supported
>
> I don't have a workaround. Because this takes up screen space=20
> it's pretty annoying.

How are you starting the server? And do you need to run it=20
remotely? As I said earlier a local git repo is better, but if=20
your language server needs more than just access to the repo it=20
becomes a slightly different matter.

> When trying to start lsp, it fails:
>
>    LSP :: The following servers support current file but do not=20
>    have automatic installation: semgrep-ls-tramp=20
>    golangci-lint-tramp gopls-tramp
>    You may find the installation instructions at=20
>    https://emacs-lsp.github.io/lsp-mode/page/languages.
>    (If you have already installed the server check *lsp-log*).

This is straying into LSP territory that might not be related to=20
TRAMP, but FWIW, are you using lsp-mode? If so I would suggest=20
eglot instead.

> That's because it doesn't find the gopls command (visible in=20
> *lsp-log*). I found that I can work around that by creating a=20
> symlink to it in /bin. The reasons seems to be
> https://emacs.stackexchange.com/questions/81829/tramp-sshfs-remote-comman=
d-execution-doesnt-respect-tramp-remote-path-or-tra
> I think it should work the same as ssh and use the remote path=20
> settings.

I personally would not do remote execution with sshfs; it's a=20
filesystem, and not a remote environment.

> magit gathers some information, but then fails with:
>
>    magit-rev-diff-count: Wrong type argument: stringp, nil
>
> This is after some more warnings about stderr, so maybe related?

You've lost me here, sorry. Can you give an MRE? I think there=20
might be too much going on.

> All of this works with tramp over ssh.=20

This might come down to what I said earlier about sshfs not being=20
an environment.

Regards,

        - Joel