All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Voelker <mail@bernhard-voelker.de>
To: "Paul Eggert" <eggert@cs.ucla.edu>, "Pádraig Brady" <P@draigBrady.com>
Cc: Petr Malat <oss@malat.biz>,
	util-linux <util-linux@vger.kernel.org>,
	Dominique Martinet <asmadeus@codewreck.org>,
	69532@debbugs.gnu.org, Karel Zak <kzak@redhat.com>,
	Rob Landley <rob@landley.net>
Subject: Re: bug#69532: mv's new -x option should be made orthogonal to -t/-T/default
Date: Wed, 20 Mar 2024 20:43:40 +0100	[thread overview]
Message-ID: <11c9a6a2-c73d-4b99-b071-48e7eab2fd19@bernhard-voelker.de> (raw)
In-Reply-To: <c5622a1c-b59e-4eb3-9d81-111acc1fbddc@cs.ucla.edu>

On 3/17/24 07:10, Paul Eggert wrote:
> Although removing that "mv --swap" implementation was a win, I don't
> think we can simply delegate this to util-linux's exch command.

I still have some headache adding this.

This stems from the fact that although mv(1) is a userland frontend
for renameat(2), the user interface is different:
while renameat(2) deals exactly with 2 operands, mv(1) has always
been able to work on more arguments.

Now, extending "exchange" to more arguments is confusing and the
use is not intuitive:
   mv -v --exchange  a b c d

An "exchange" can literally only be applied to 2 files,
and 'exch' is IMO fine.

I have the gut feeling that we didn't think through all cases,
and that some might be surprising, e.g.:

   $ mkdir d; echo 1 > a; echo 2 > d/a
   $ src/mv --exchange a a a a d/a

versus

   $ src/mv --exchange a a a a d/a

Have a nice day,
Berny


  parent reply	other threads:[~2024-03-20 19:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <10c814a7-cb68-4fb4-ad8d-f88f286fb0b1@cs.ucla.edu>
     [not found] ` <58281f96-f9c6-4567-e3c9-c6a6cfa6ce27@draigBrady.com>
     [not found]   ` <ZeZqzB4-OzHYfFeQ@codewreck.org>
     [not found]     ` <5914e8b2-48ac-456b-9753-6a7bae7a9bbb@cs.ucla.edu>
2024-03-05 14:16       ` bug#69532: mv's new -x option should be made orthogonal to -t/-T/default Pádraig Brady
2024-03-05 20:41         ` Karel Zak
2024-03-05 22:13         ` Masatake YAMATO
2024-03-17  6:10         ` Paul Eggert
2024-03-17 11:32           ` Pádraig Brady
2024-03-17 11:40             ` Pádraig Brady
2024-03-20 22:10             ` Paul Eggert
2024-03-20 19:43           ` Bernhard Voelker [this message]
2024-03-20 20:56             ` Paul Eggert
2024-03-20 22:53               ` Bernhard Voelker
2024-03-20 23:56                 ` Paul Eggert
2024-03-21 21:45                   ` Bernhard Voelker
2024-03-23  1:44                     ` Paul Eggert
2024-03-23 10:24                       ` Bernhard Voelker
2024-03-22 10:22                 ` Karel Zak
2024-03-23 10:24                   ` Bernhard Voelker
2024-03-21  0:03             ` Rob Landley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11c9a6a2-c73d-4b99-b071-48e7eab2fd19@bernhard-voelker.de \
    --to=mail@bernhard-voelker.de \
    --cc=69532@debbugs.gnu.org \
    --cc=P@draigBrady.com \
    --cc=asmadeus@codewreck.org \
    --cc=eggert@cs.ucla.edu \
    --cc=kzak@redhat.com \
    --cc=oss@malat.biz \
    --cc=rob@landley.net \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.