GNU bug report logs - #69085
29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods

Previous Next

Package: emacs;

Reported by: Sean Devlin <spd <at> toadstyle.org>

Date: Mon, 12 Feb 2024 20:11:01 UTC

Severity: normal

Found in version 29.2

Fixed in version 30.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sean Devlin <spd <at> toadstyle.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 69085 <at> debbugs.gnu.org
Subject: bug#69085: 29.2; Tramp: Extend tramp-make-copy-program-file-name via tramp-methods
Date: Fri, 16 Feb 2024 12:51:17 -0500
Hi Michael,

>> I think what is needed is some way for the tramp-docker method to
>> specify the format for remote paths in the OOB copy command, since
>> tramp-make-copy-program-file-name will include the user if it is
>> specified in the connection.
>> 
>> One method might be to add a key to tramp-methods that lets you
>> specify the format similar to tramp-login-args and tramp-copy-args:
> 
> I've tried another approach. In Tramp 2.7, I've added a new method
> "dockercp" which doesn't use the user at all, and which adds
> tramp-copy-program and tramp-copy-args.
> 
> Do you have a chance to install Tramp from its repository like
> 
> --8<---------------cut here---------------start------------->8---
> # git clone https://git.savannah.gnu.org/git/tramp.git
> --8<---------------cut here---------------end--------------->8---
> 
> Then pls modify tramp-container.el with the appended patch. After that,
> you should be able to access your docker container like
> /dockercp:CONTAINER:/path/to/file. And if you copy large files, "docker
> cp" will be applied.

The patch does work as described, but it doesn’t integrate well with typical
workflows.

For example, I’m likely to start a session from Eshell or Dired browsing
around the remote. At this point, I may not realize I will need to copy files to
or from the remote. I would start with the normal “docker” method, because
I usually want to have an explicit user for my connection, so that I can run
programs as the user.

Now, suppose I do need to copy a file back to the host. I need to:

1. Check the size of the file. If it’s small, I can copy it normally using the
inline method.

2. If the file is big, I now need to switch to the other method, so I open a new
connection to the same container under the “dockercp” method.

3. I also need to find my way back to the same directory. This may be a
minor nuisance, but for example it won’t show up in the Recentf list, since
Emacs and Tramp and Recentf will not know that
/docker:user <at> container:/path/to/dir and /dockercp:container:/path/to/dir are
related.

4. Finally, I copy the file.

So while this approach does work for Docker containers, it adds some
ergonomic overhead for the user making it inconvenient to use.

Thanks,

Sean





This bug report was last modified 1 year and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.