3

I'm trying to use Magit with TRAMP. The remote host has multiple git versions, necessitating

(add-to-list 'tramp-remote-path "/usr/sup/bin")

in my .emacs. However, when I run magit-status in a TRAMP buffer, I get this error message in *Messages*:

magit-insert-head-branch-header: Wrong type argument: stringp, nil

And it is accompanied by this message in *Warnings*:

Error (magit): Magit requires Git >= 2.0.0, but on /ssh:nr@homework: the version is 1.8.3.

If multiple Git versions are installed on the host, then the
problem might be that TRAMP uses the wrong executable.

First check the value of `magit-git-executable'.  Its value is
used when running git locally as well as when running it on a
remote host.  The default value is "git", except on Windows
where an absolute path is used for performance reasons.

If the value already is just "git" but TRAMP never-the-less
doesn't use the correct executable, then consult the info node
`(tramp)Remote programs'.

Information about the context:

  • The value of magit-git-executable is "git".

  • The value of tramp-remote-path is ("/usr/sup/bin" tramp-default-remote-path "/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin" "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin" "/opt/bin" "/opt/sbin" "/opt/local/bin").

  • On the remote host, there is a /usr/sup/bin/git with version 2.19.1.

My question: how I can figure out the absolute pathname of the git that Magit is running on the remote host?

Possibly relevant question: magit with tramp is not working with git correctly

  • Not an answer to your question, but it may give more information: M-x toggle-debug-on-error, try it again and look at the backtrace (or add it to the question). – NickD Jan 23 at 0:02
2

If the value already is just "git" but TRAMP never-the-less doesn't use the correct executable, then consult the info node `(tramp)Remote programs'.

Did you do that? It says:

When remote search paths are changed, local TRAMP caches must be recomputed. To force TRAMP to recompute afresh, exit Emacs, remove the persistent file (*note Connection caching::), and restart Emacs.

And you would probably use:

6.6 Cleanup remote connections

TRAMP provides several ways to flush remote connections.

-- Command: tramp-cleanup-connection vec This command flushes all connection related objects. ‘vec’ is the internal representation of a remote connection. When called interactively, this command lists active remote connections in the minibuffer. Each connection is of the format ‘/method:user@host:’. Flushing remote connections also cleans the password cache (*note Password handling::), file cache, connection cache (*note Connection caching::), and connection buffers.

-- Command: tramp-cleanup-this-connection Flushes only the current buffer’s remote connection objects, the same as in ‘tramp-cleanup-connection’.

-- Command: tramp-cleanup-all-connections Flushes all active remote connection objects, the same as in ‘tramp-cleanup-connection’.

-- Command: tramp-cleanup-all-buffers Just as for ‘tramp-cleanup-all-connections’, all remote connections are cleaned up in addition to killing buffers related to that remote connection.

  • Consulted the info page, but missed the part about the cache. Problem solved! Thanks kindly. – Norman Ramsey Jan 26 at 15:41

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.