[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling vc commands when visiting a remote file via Tramp?

From: Skip Montanaro
Subject: Re: Enabling vc commands when visiting a remote file via Tramp?
Date: Mon, 18 Sep 2017 09:56:21 -0500


Thanks for the quick response. I would be in software support heaven
if my corporate and vendor support staff were as responsive as you
have always been. In my mind, Tramp is one of the "killer apps" for

TL;DR - setting the path to my remote (and local) git executable
solved the problem.

> vc-ignore-dir-regexp with its default settings does not seem to disturb Tramp.

Good to know.

> How do you access your remote machine? Which Tramp method do you use?
> Which vc backend do you use? Personally, I access the remote machine via
> Tramp's ssh/scp methods, using git. I believe, bzr and cvs ought to work
> also, but that's years ago.

I'm currently using the default, scp.

> What does (vc-registered "<remote file path>") tells you? Pls run it
> when you have set tramp-verbose to 6 in advance; I would like to see
> which Tramp commands were sent.

That seems revealing. Apologies, but it's challenging to get exact
output out of my work environment. I only have "gaze-and-type", not
"copy-and-paste". However, (vc-registered "<remote file path>")
returns nil, and looking in my debug tramp buffer, I see it try a
bunch of different version control paths, including this:

("/home/skipm/src/git/vmap/.git" "file-exists-p" t)
("/home/skipm/src/git/vmap/.git" "file-readable-p" t)

That is the top level directory of the repo, so is where I'd expect to find it.

> Is it possible for you to use vc operations on local files, prefixed with 
> "/ssh::"?

No. Again, it comes up fine, and lots of different version control
systems are tried, but it seems to ignore the positive finding of .git
in the file's directory. The same positive result is logged when it
operates locally, and it continues trying all the way up to /, however
git works fine when operating locally.

Aha! Our git executable is in an atypical location. This isn't a
problem locally, as that directory is in PATH when Emacs is run, but
it appears not to use that location when hunting for a remote git
executable. Explicitly setting vc-git-program to the full path to the
executable seems to have solved the problem. Fortunately, the path to
git is the same on the local machine as the remote. To be on the safe
side, is there a way to force it to use a specific remote path for
git, but just continue to rely on PATH for local use?

Finally, in the answer to the "how to speed up Tramp?" question in the
documentation, you might want to mention that users can (I think)
safely trim the vc-handled-backends to just those they care about.
It's not a big deal when operating over a LAN, but would result in
many fewer needless probes for nonexistent files when operating over
slower networks. I set mine like so in ~/.emacs:

(setq vc-handled-backends '(SVN Git))

Alas, SVN and Git are two of the slowest probes, since they appear to
always check all the way to / (why not stop when file-exists-p and
file-readable-p both return t?), but still, the change resulted in
many fewer vc probes, 28 v. 96 in this simple example.

Thanks for the help, especially the tramp-verbose nudge.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]