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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 14 May 2025 14:31:31 +0300

> Cc: [email-masked]
> From: Sean Whitton <[email-masked]>
> Date: Tue, 13 May 2025 18:59:02 +0100
> 
> On Tue 13 May 2025 at 02:06pm +02, Manuel Giraud wrote:
> 
> > Hi,
> >
> > Using git, it seems that `vc-next-action' from a *vc-diff* buffer on
> > remote files does not work anymore.  Here's a recipe:
> >
> >      - emacs -Q
> >      - C-x C-f /-:host:/path/to/file/in_a_git_repo
> >      - *some edit*
> >      - C-x v =  ;; now in a *vc-diff* buffer
> >      - C-x v v  ;; jumps to *vc-log* buffer
> >      - *edit log* and C-c C-c
> >
> > I get the following error in the *Messages* buffer:
> > vc-do-command: Failed (status 128): git --no-pager apply --cached /scp:host:/tmp/git-patch2KyUYD .
> >
> > and the *vc* buffer contains:
> > error: can't open patch '/scp:host:/tmp/git-patch2KyUYD': No such file or directory
> >
> > Note: this works locally and this also works on remote file when there
> > is no *vc-diff* buffer involved.
> 
> Thanks.  The problem was introduced by my commit
> 7f60aa45aab4191a44d6d83ec6c3004e4901469b.
> 
> I am not sure how to fix it, yet.

If you could explain the rationale for that commit and why you changed
the code in that particular way, maybe someone here could suggest a
solution.