Subject: bug#32127: RFE -- in the way "cp -rl" -- enable 'ln' to do likewise?

From: Erik Auerswald <[email-masked]>
Date: Tue, 17 Jul 2018 11:20:08 +0200

Hi,

On Mon, Jul 16, 2018 at 11:14:21PM +0200, Bernhard Voelker wrote:
> On 07/14/2018 07:51 PM, L A Walsh wrote:
> > Paul Eggert wrote:
> >> On 07/12/2018 02:16 AM, L A Walsh wrote:
> >>>     I'm asking why does 'ln' bother to tell the user that they are
> >>> wrong and do nothing useful?  Why not just go ahead and create a symlink
> >>
> >> The user didn't ask for a symlink,
> > User didn't ask for a physical or hardlink (-P) either.  Just asked
> > for a link, kind unspecified.
> > 
> >> and it sounds unwise for ln to be
> >> second-guessing that.
> > ---
> >   True - should **probably** have given them *SOME* link.  Since
> > they didn't specify Physical or Symlink...either would be fine.
> > 
> > 
> >> Sometimes, reporting an error and exiting is a
> >> better thing to do.
> > ---
> > 	Unless they claim to want one or the other (-P or -l), unless
> > it is an "undo-able" operation (like one that deletes data), why would
> > you guarantee ln doing the wrong thing, rather than having a better than
> > 50% chance of doing the right thing?
> 
> I disagree here: some people are not that familiar with the differences
> between symlinks and hardlinks, okay, but the consequences for using either
> type may be quite dramatic later on.  Therefore I think it's better to give
> a helping error instead of second-guessing what the user *may* have wanted.
> The point is: also an experienced user may sometimes forget to specify
> the -s option, and I'm sure they *want* a proper error message.

Just as food for thought: how about adding an option to ln to try to do
the right thing? That option could be used in an alias so that it is not
needed to always type it. Perhaps in time some GNU/Linux distributions
even add that option to their default aliases.

The option name could be --do-what-i-mean or --do-the-right-thing
or --fallback-symbolic (I am quite sure everyone can come with
additionalsuggestions. ;) Please do not take these suggestions too
seriously. ;-)

Anyway, I understand both sides of this discussion, and I definitely do
not expect anyone to go ahead and implement my solution. It is just a
suggestion for whomever wants to have this functionality, and intends
to implement it themselves, on how to find a compromise that might be
acceptable upstream.

Peace,
Erik
-- 
Be water, my friend.
                        -- Bruce Lee