From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Devlin Newsgroups: gmane.emacs.bugs 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 Message-ID: <35B8D855-8524-4B91-B102-5DD9DF81B2EE@toadstyle.org> References: <327CF2FD-F00D-402B-B273-12066DDEB0E5@toadstyle.org> <875xytjsfw.fsf@gmx.de> <76B2D222-939F-4096-AFA5-2B0AA92A9A03@toadstyle.org> <8734twimm3.fsf@gmx.de> <87r0hfh6p1.fsf@gmx.de> <70162BD1-DC02-4838-9197-37249010B192@toadstyle.org> <87eddctq6a.fsf@gmx.de> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.141\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38593"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69085@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 16 18:52:59 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rb2OR-0009oh-FO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Feb 2024 18:52:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb2OE-0008Bt-5f; Fri, 16 Feb 2024 12:52:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb2OB-0008Bh-Ec for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 12:52:43 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb2OA-0001eY-RO for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 12:52:43 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rb2OU-0002ib-4u for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 12:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Feb 2024 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69085 X-GNU-PR-Package: emacs Original-Received: via spool by 69085-submit@debbugs.gnu.org id=B69085.170810597910439 (code B ref 69085); Fri, 16 Feb 2024 17:53:02 +0000 Original-Received: (at 69085) by debbugs.gnu.org; 16 Feb 2024 17:52:59 +0000 Original-Received: from localhost ([127.0.0.1]:60179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb2OQ-0002iJ-H8 for submit@debbugs.gnu.org; Fri, 16 Feb 2024 12:52:58 -0500 Original-Received: from mail-vk1-f179.google.com ([209.85.221.179]:48342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb2OL-0002i4-MW for 69085@debbugs.gnu.org; Fri, 16 Feb 2024 12:52:56 -0500 Original-Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-4c1d1e841e2so244397e0c.0 for <69085@debbugs.gnu.org>; Fri, 16 Feb 2024 09:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20230601.gappssmtp.com; s=20230601; t=1708105888; x=1708710688; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KeajBJr0n1zubNvqS2xr3nP6Kw22klZIedeoTHbtwJg=; b=G57eOYtswcCWUxIsxLmRmKSW2SuyWUSqrBx2M5g9q8oiB5DNMH+U9V757pNtA41A1i 8KgexBk8DtFDR4tJPPArZGPKyTR4Jpfrz+4qmVROut3+XgNVRdtHv+8Naqy0OZ1LETga jGHrc3HXwss5ML4PMRAITWjMSTILk4s57SR8ez95Vvf2rydLxnMv1EoYp8Kur0fDwff5 3pwOgQK919lBAIYsNFL2qXA59udzoIT7cxHnXabjE99I79GhPURjNcZrFuwmQ8RvtbxI WaqSxv/G+bZ9H7q0hQIkECRLU03//QXnUbCIfT0GDR8EFGDx8jAO2QUKJGRHfGPLkzNi I0zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708105888; x=1708710688; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KeajBJr0n1zubNvqS2xr3nP6Kw22klZIedeoTHbtwJg=; b=FVzcxLjKxBDQBh7Z7WY4urwfOWSD7cyimckVo4rcHaztok6vXbqb37HI1M4B4sVDxQ X/umZjc4n34GMENLH53wJeHplV+0APxNLi9efo+iydW3/jxSANlxbcj3D/NfMEiEb5Ss Mv6+irB/O7IOyEyccB9UTD8wl/VWucXx7BBwSM9h+54iy/9ePVDjC7UvyvQ1T+ck0gxi ToZ3ZJIhfMfo31bVsgBhSztW0A+XZoY+Uc1UiDjhVcDQradmWnmm7imhi/9eu1876MD2 riTI79uYygeexgg9SX/pOnIx1G+K62qyDOK2PWSFHKjyww9gttYmJefWWrRSQK/QF9sR BT4g== X-Gm-Message-State: AOJu0YwOC0XKEUPl8lwnqccUts8bo3UcNKGhj1CaUFOj3Zy26+nV1cby jNMotn0OIb+71yxWO6Fkjs4p7+o1Jdy9sDTCfjdXwf8QV1ixRrvR+b+kNOGkZWU= X-Google-Smtp-Source: AGHT+IHILLbOqGVD8tiZFI697si2FFrIRnRT3FpR3p0pwv8mH2Y5wRqQC8KzhI//Azo7lKJlD6vKEg== X-Received: by 2002:a1f:ca46:0:b0:4c0:25a4:95bb with SMTP id a67-20020a1fca46000000b004c025a495bbmr4509985vkg.8.1708105888465; Fri, 16 Feb 2024 09:51:28 -0800 (PST) Original-Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id ks6-20020a056214310600b0068f2b9a6ec7sm129805qvb.18.2024.02.16.09.51.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2024 09:51:28 -0800 (PST) In-Reply-To: <87eddctq6a.fsf@gmx.de> X-Mailer: Apple Mail (2.3774.500.141) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280105 Archived-At: 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. >>=20 >> 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: >=20 > 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. >=20 > Do you have a chance to install Tramp from its repository like >=20 > --8<---------------cut here---------------start------------->8--- > # git clone https://git.savannah.gnu.org/git/tramp.git > --8<---------------cut here---------------end--------------->8--- >=20 > 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=E2=80=99t integrate well = with typical workflows. For example, I=E2=80=99m 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 =E2=80=9Cdocker=E2=80=9D= 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=E2=80=99s 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 =E2=80=9Cdockercp=E2=80=9D = 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=E2=80=99t show up in the Recentf = list, since Emacs and Tramp and Recentf will not know that /docker:user@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