GNU bug report logs - #31941
26.1; Moving directory on remote host via tramp scp always performs copy

Previous Next

Package: emacs;

Reported by: Stephen Nutt <stnutt <at> gmail.com>

Date: Fri, 22 Jun 2018 19:41:02 UTC

Severity: normal

Tags: fixed

Found in version 26.1

Fixed in version 26.2

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31941 in the body.
You can then email your comments to 31941 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31941; Package emacs. (Fri, 22 Jun 2018 19:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Nutt <stnutt <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 22 Jun 2018 19:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Nutt <stnutt <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1;
 Moving directory on remote host via tramp scp always performs copy
Date: Fri, 22 Jun 2018 14:33:50 -0500
In Emacs 26, when moving a directory within a remote host over Tramp
using the scp method (e.g. with dired-do-rename or mv in eshell), a copy
and delete are always performed, even when a much simpler mv would
suffice. The behavior is the same when running emacs with -q or with
emacs built from master. This is a regression from the behavior in 25.3.

I think I've isolated the change to the commit b500e0 where the
following was added at the beginning of `tramp-do-copy-or-rename-file'
in tramp-sh.el to explicitly call `copy-directory'.

  (if (file-directory-p filename)
      (progn
	(copy-directory filename newname keep-date t)
	(when (eq op 'rename) (delete-directory filename 'recursive)))

I think the conditional should also check if op is a rename and if the
remote of filename and newname are the same, in which case the normal
behavior of the function should proceed which should result in a mv
command.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31941; Package emacs. (Sun, 24 Jun 2018 08:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 31941 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stephen Nutt <stnutt <at> gmail.com>
Cc: 31941 <at> debbugs.gnu.org
Subject: Re: bug#31941: 26.1;
 Moving directory on remote host via tramp scp always performs copy
Date: Sun, 24 Jun 2018 10:31:35 +0200
[Message part 1 (text/plain, inline)]
Stephen Nutt <stnutt <at> gmail.com> writes:

Hi Stephen,

> In Emacs 26, when moving a directory within a remote host over Tramp
> using the scp method (e.g. with dired-do-rename or mv in eshell), a copy
> and delete are always performed, even when a much simpler mv would
> suffice. The behavior is the same when running emacs with -q or with
> emacs built from master. This is a regression from the behavior in 25.3.
>
> I think I've isolated the change to the commit b500e0 where the
> following was added at the beginning of `tramp-do-copy-or-rename-file'
> in tramp-sh.el to explicitly call `copy-directory'.
>
>   (if (file-directory-p filename)
>       (progn
> 	(copy-directory filename newname keep-date t)
> 	(when (eq op 'rename) (delete-directory filename 'recursive)))
>
> I think the conditional should also check if op is a rename and if the
> remote of filename and newname are the same, in which case the normal
> behavior of the function should proceed which should result in a mv
> command.

Thanks for the bug report. I've fixed this in the emacs-26 branch of the
repository, will appear with Emacs 26.2.

The patch will be also part of Tramp 2.3.4, which is scheduled for
release next week.

The patch is appended, pls check whether it works for you.

Best regards, Michael.

[Message part 2 (text/plain, attachment)]

Added tag(s) fixed. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Sun, 24 Jun 2018 08:33:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31941; Package emacs. (Sun, 24 Jun 2018 12:08:02 GMT) Full text and rfc822 format available.

Message #13 received at 31941 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Nutt <stnutt <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 31941 <at> debbugs.gnu.org
Subject: Re: bug#31941: 26.1;
 Moving directory on remote host via tramp scp always performs copy
Date: Sun, 24 Jun 2018 07:06:13 -0500
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Thanks for the bug report. I've fixed this in the emacs-26 branch of the
> repository, will appear with Emacs 26.2.
>
> The patch will be also part of Tramp 2.3.4, which is scheduled for
> release next week.
>
> The patch is appended, pls check whether it works for you.
>
> Best regards, Michael.

The patch fixes it. Thanks.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Mon, 25 Jun 2018 06:44:02 GMT) Full text and rfc822 format available.

Notification sent to Stephen Nutt <stnutt <at> gmail.com>:
bug acknowledged by developer. (Mon, 25 Jun 2018 06:44:02 GMT) Full text and rfc822 format available.

Message #18 received at 31941-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stephen Nutt <stnutt <at> gmail.com>
Cc: 31941-done <at> debbugs.gnu.org
Subject: Re: bug#31941: 26.1;
 Moving directory on remote host via tramp scp always performs copy
Date: Mon, 25 Jun 2018 08:43:17 +0200
Version: 26.2

Stephen Nutt <stnutt <at> gmail.com> writes:

>> The patch is appended, pls check whether it works for you.
>
> The patch fixes it. Thanks.

Thanks for the feedback, I'm closing the bug.

Best regards, Michael.







bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 23 Jul 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 273 days ago.

Previous Next


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