magit seems to open a new ssh connection for every command. This becomes very annoying especially when staging more chunks, which takes noticeable time to establish the connection for each chunk.
(from shell, I have persistent ssh connections enabled via ./ssh/config)
I am not sure whether this is a magit or a tramp thing.
But my question is:
How can I make magit re-use the ssh-connection?
EDIT:
The client is
- tramp 2.3.5.26.2
- GNU Emacs 26.1.91
- debian (testing)
- this is the tramp configuration
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
(setq tramp-default-method "ssh")
(setq tramp-inline-compress-start-size 1000000)
- this is the relevant part of my .ssh/config
## generally re-use existing connections
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
Host myhost1
HostName 111.11.11.1
User myuser
ForwardX11 yes
ForwardX11Timeout 596h
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
ForwardAgent yes
SendEnv LC_*
ServerAliveInterval 300
The server is RHEL 7.6 (Maipo)
Host *
is still applied when it matchesHost myhost1
, so you may want to verify that, but it shouldn't matter for Tramp in such a recent Emacs version, as it should be trying to use ControlMaster regardless. I would definitely try to confirm outside of Emacs whether ControlMaster is working for you, however. You ought to see a difference betweenssh <host>
andssh -Snone <host>
if it's working. – Gummitetramp-verbose
as well, and then check the*debug tramp/foo*
to see whether you get any useful information in those logs. – Gummite