GNU bug report logs - #69532
mv's new -x option should be made orthogonal to -t/-T/default

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 4 Mar 2024 00:46:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Pádraig Brady <P <at> draigBrady.com>
Cc: Petr Malat <oss <at> malat.biz>, util-linux <util-linux <at> vger.kernel.org>, Dominique Martinet <asmadeus <at> codewreck.org>, 69532 <at> debbugs.gnu.org, Karel Zak <kzak <at> redhat.com>, Rob Landley <rob <at> landley.net>
Subject: bug#69532: mv's new -x option should be made orthogonal to -t/-T/default
Date: Thu, 21 Mar 2024 22:45:24 +0100
On 3/21/24 00:56, Paul Eggert wrote:
> On 3/20/24 15:53, Bernhard Voelker wrote:
> Yes, that's the expected behavior for this contrived case. Just as one
> would get odd behavior if one did the same thing without --exchange.

There's another which is not consistent with/without --exchange:

  $ src/mv -v a a
  src/mv: 'a' and 'a' are the same file

  $ src/mv -v --exchange a a
  renamed 'a' -> 'a'

RENAME_EXCHANGE is allowed (but useless?) for 1 file.

BTW: shouldn't the -v diagnostic better say "exchanged 'a' <-> 'a'"
because that's what happened?

>>     - not sure if exchange works well together with -f.
>
> What problems do you see there?

it's up to the tests to proof that.

>> why does exchange not work to exchange a regular with a
>> directory file?
>
> It works. I don't see a problem there.
>
>     $ touch a
>     $ mkdir d
>     $ ./mv -T --exchange a d
>     $ ls -ld a d
>     drwxr-xr-x. 2 eggert eggert 4096 Mar 20 16:52 a
>     -rw-r--r--. 1 eggert eggert    0 Mar 20 16:52 d

indeed, it works.  It seems my test was wrong, sorry.

>> Finally, the test cases are very sparse:
>
> Feel free to add some. :-)

Unfortunately, I cannot currently spend as much time as I'd love to.

It seems that -i is skipped:

  $ src/mv -iv --exchange a b
  renamed 'a' -> 'b'

As far as I know Padraig would like to do the next release very soon,
so I would recommend to not hurrying this one into it, and instead
ironing all out after the release.

Have a nice day,
Berny




This bug report was last modified 1 year and 152 days ago.

Previous Next


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