GNU bug report logs - #74352
29.4; emerge-files with tramp + local file fails

Previous Next

Package: emacs;

Reported by: Jörg Sommer <joerg <at> jo-so.de>

Date: Thu, 14 Nov 2024 04:53:02 UTC

Severity: normal

Tags: confirmed

Merged with 6850

Found in versions 24.0.50, 29.4

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jörg Sommer <joerg <at> jo-so.de>
Cc: 74352 <at> debbugs.gnu.org
Subject: bug#74352: 29.4; emerge-files with tramp + local file fails
Date: Sat, 16 Nov 2024 13:21:32 +0100
Jörg Sommer <joerg <at> jo-so.de> writes:

> Hi,

Hi Jörg,

> when running `emerge-files` with `/ssh:remote:file` and `~/local-file` I get
> the buffer `*emerge-diff-errors*` with:
>
> ```
> diff: /tmp/tramp.wlcRNL: No such file or directory
> diff: /home/joerg/local-file: No such file or directory
> ```

I can reproduce the problem if file-A is remote, and file-B is
local. Also, if both file-A and file-B are remote.

If both files are local, or file-A is local and file-B is remote, emerge
works as exptected.

The crucial point seems to be that file-A is a remote one.

> This change solves the problem:
>
> ```diff
> diff --git lisp/vc/emerge.el lisp/vc/emerge.el
> index ca48f2f3c7b..562041e4232 100644
> --- lisp/vc/emerge.el
> +++ lisp/vc/emerge.el
> @@ -581,6 +581,7 @@ emerge-make-diff-list
>    (setq emerge-diff-buffer (get-buffer-create "*emerge-diff*"))
>    (with-current-buffer
>        emerge-diff-buffer
> +    (setq default-directory (file-name-directory file-A))
>      (erase-buffer)
>      (shell-command
>       (format "%s %s %s %s"
> ```

The point is, that emerge calls the 'diff' program for either the file
itself (if local), or a local copy of the file (if remote). A consistent
solution is therefore to set a local default directory, like

--8<---------------cut here---------------start------------->8---
    (setq default-directory temporary-file-directory)
--8<---------------cut here---------------end--------------->8---

instead of your change. Would you like to check?

However, this won't be a complete solution. There are other places in
emerge.el, where the temporary buffer for calling 'diff' must have a
local default directory. I'm not an emerge aficionado (haven't used it
until now). Would you like to produce a complete patch, based on my
proposal above?

> Regards Jörg

Best regards, Michael.




This bug report was last modified 111 days ago.

Previous Next


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