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

From: Manuel Giraud <[email-masked]>
Date: Wed, 14 May 2025 14:01:09 +0200

Sean Whitton <[email-masked]> writes:

> Hello,
>
> 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.

Thanks for looking into this.  I don't really understand the goal of
your commit but maybe is related to the fact that 'patch-file' and
'cached' there end up having a TRAMP form (like "/scp:host:/foo") that
git cannot understand.
-- 
Manuel Giraud