From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#60011: 30.0.50; git commit from *vc-diff* does not work over tramp Date: Tue, 13 Dec 2022 19:16:17 +0200 Organization: LINKOV.NET Message-ID: <86lenbw7w6.fsf@mail.linkov.net> References: <86h6y0o4qy.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27601"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Sam Steingold , 60011@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 13 18:30:42 2022 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 1p5973-000722-Vh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Dec 2022 18:30:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p596T-0002lb-Du; Tue, 13 Dec 2022 12:30:05 -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 1p596S-0002kr-91 for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 12:30:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p596R-0007Vb-Vy for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 12:30:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p596R-0006h8-RX for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 12:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2022 17:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60011 X-GNU-PR-Package: emacs Original-Received: via spool by 60011-submit@debbugs.gnu.org id=B60011.167095255725665 (code B ref 60011); Tue, 13 Dec 2022 17:30:03 +0000 Original-Received: (at 60011) by debbugs.gnu.org; 13 Dec 2022 17:29:17 +0000 Original-Received: from localhost ([127.0.0.1]:33490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p595h-0006ft-1F for submit@debbugs.gnu.org; Tue, 13 Dec 2022 12:29:17 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:33241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p595e-0006fk-Jj for 60011@debbugs.gnu.org; Tue, 13 Dec 2022 12:29:15 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 289A8C000A; Tue, 13 Dec 2022 17:29:05 +0000 (UTC) In-Reply-To: <86h6y0o4qy.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 12 Dec 2022 20:29:09 +0200") 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:250862 Archived-At: --=-=-= Content-Type: text/plain Hi Michael, Could you please confirm that I correctly implemented support for Tramp in the following patch. >> I run Emacs locally (macosx laptop) and edit remote (Amazon Linux "cloud >> desktop") files using tramp (scp). >> I can commit files using vc/git just fine. >> However, when I edit *vc-diff* and hit C-v v v (vc-next-action), and >> then edit the commit message abd hit C-c C-c, I get this error: >> Debugger entered--Lisp error: (error "Failed (status 128): git --no-pager apply --cached...") > > The problem is in these lines that create a temporary file > on a local directory only: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=tramp-vc-git-checkin.patch diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 83138a6d107..65604e84d0e 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -103,6 +103,7 @@ (require 'vc-dispatcher) (eval-when-compile (require 'subr-x) ; for string-trim-right + (require 'tramp) (require 'vc) (require 'vc-dir)) @@ -1048,7 +1049,13 @@ vc-git-checkin (string-replace file-diff "" vc-git-patch-string)) (user-error "Index not empty")) (setq pos (point)))))) - (let ((patch-file (make-temp-file "git-patch"))) + (let ((patch-file + (if (file-remote-p default-directory) + (with-parsed-tramp-file-name + (expand-file-name default-directory) nil + (tramp-make-tramp-file-name + v (with-no-warnings (tramp-make-tramp-temp-file v)))) + (make-temp-file "git-patch")))) (with-temp-file patch-file (insert vc-git-patch-string)) (unwind-protect --=-=-=--