all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Enabling vc commands when visiting a remote file via Tramp?
@ 2017-09-18 13:09 Skip Montanaro
  2017-09-18 13:55 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Skip Montanaro @ 2017-09-18 13:09 UTC (permalink / raw
  To: Help GNU Emacs

I'm doing development in a docker environment, and find it handy to
just visit files using Tramp instead of starting up a second Emacs
instance on my Docker machine (which is not my normal machine - not my
choice, nothing I can do about it). This works fine for the most part
(proper modes are displayed, for example), and the difference between
explicitly visiting a remote file (Tramp) vs implicitly visiting that
same file (NFS) isn't worth worrying about.

Still,  version control detection and support appears to be
nonexistent by default. I see that vc-ignore-dir-regexp is set to some
inscrutable regular expression. That might, or might not, be the key.
Is there a known setting of that variable which will unlock the magic
of vc through Tramp?

Thx,

Skip Montanaro



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Enabling vc commands when visiting a remote file via Tramp?
  2017-09-18 13:09 Enabling vc commands when visiting a remote file via Tramp? Skip Montanaro
@ 2017-09-18 13:55 ` Michael Albinus
  2017-09-18 14:56   ` Skip Montanaro
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2017-09-18 13:55 UTC (permalink / raw
  To: Skip Montanaro; +Cc: Help GNU Emacs

Skip Montanaro <skip.montanaro@gmail.com> writes:

Hi Skip,

> Still,  version control detection and support appears to be
> nonexistent by default. I see that vc-ignore-dir-regexp is set to some
> inscrutable regular expression. That might, or might not, be the key.
> Is there a known setting of that variable which will unlock the magic
> of vc through Tramp?

I'll do vc operations on remote hosts on a daily basis, no problem. I've
just rechecked my init files, there's nothing for a special vc
configuration.

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

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.

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.

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

> Thx,
>
> Skip Montanaro

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Enabling vc commands when visiting a remote file via Tramp?
  2017-09-18 13:55 ` Michael Albinus
@ 2017-09-18 14:56   ` Skip Montanaro
  2017-09-18 15:33     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Skip Montanaro @ 2017-09-18 14:56 UTC (permalink / raw
  To: Michael Albinus; +Cc: Help GNU Emacs

Michael,

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
Emacs.

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.

Skip



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Enabling vc commands when visiting a remote file via Tramp?
  2017-09-18 14:56   ` Skip Montanaro
@ 2017-09-18 15:33     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2017-09-18 15:33 UTC (permalink / raw
  To: Skip Montanaro; +Cc: Help GNU Emacs

Skip Montanaro <skip.montanaro@gmail.com> writes:

> Michael,

Hi Skip,

> 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
> Emacs.

Well, that makes the difference: Tramp is my pet project. @work, I'm
slower. (Not too much, if somebody from my company is reading this)

> 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?

Yep. There is tramp-remote-path. Apply

(setq tramp-remote-path (cons "/path/to/git/dir" tramp-remote-path)

> 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))

Thanks for the hint, I'll do so.

> Skip

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-18 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-18 13:09 Enabling vc commands when visiting a remote file via Tramp? Skip Montanaro
2017-09-18 13:55 ` Michael Albinus
2017-09-18 14:56   ` Skip Montanaro
2017-09-18 15:33     ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.