GNU bug report logs - #78405
31.0.50; vc-next-action from *vc-diff* on remote file: Git error

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Tue, 13 May 2025 12:07:01 UTC

Severity: normal

Found in version 31.0.50

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Sean Whitton <spwhitton <at> spwhitton.name>, Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 78405 <at> debbugs.gnu.org
Subject: bug#78405: 31.0.50; vc-next-action from *vc-diff* on remote file: Git error
Date: Thu, 15 May 2025 01:40:48 +0300
On 14/05/2025 17:36, Sean Whitton wrote:
> The FILES-OR-LIST argument to vc-do-command is meant to be VCS-managed
> file names, only.  The temporary patch file is not that, so it shouldn't
> be passed through there.
> 
> The actual bug was that the paths to temporary files were being
> relativised to the repository root by the call to file-relative-name in
> vc-do-command.
> 
> We need to de-TRAMP the temporary file name before passing it to git.

Something like (100% untested)?

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 4acacaff203..3feb957271a 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1206,7 +1206,7 @@ vc-git-checkin
           (with-temp-file patch-file
             (insert vc-git-patch-string))
           (unwind-protect
-              (vc-git-command nil 0 nil "apply" "--cached" patch-file)
+              (vc-git-command nil 0 nil "apply" "--cached" 
(file-local-name patch-file))
             (delete-file patch-file))))
       (when to-stash (vc-git--stash-staged-changes to-stash)))
     ;; When operating on the whole tree, better pass "-a" than ".",
@@ -1232,7 +1232,7 @@ vc-git-checkin
         (unwind-protect
             (progn (with-temp-file cached
                      (vc-git-command t 0 nil "stash" "show" "-p"))
-                   (vc-git-command nil 0 nil "apply" "--cached" cached))
+                   (vc-git-command nil 0 nil "apply" "--cached" 
(file-local-name cached)))
           (delete-file cached))
         (vc-git-command nil 0 nil "stash" "drop")))))







This bug report was last modified 5 days ago.

Previous Next


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