GNU bug report logs -
#60011
30.0.50; git commit from *vc-diff* does not work over tramp
Previous Next
Reported by: sds <at> gnu.org
Date: Mon, 12 Dec 2022 16:33:02 UTC
Severity: normal
Found in version 30.0.50
Fixed in version 29.0.60
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 60011 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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:
[tramp-vc-git-checkin.patch (text/x-diff, inline)]
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
This bug report was last modified 2 years and 215 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.