zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH v2 2/3] Fix the ':A' word modifier on paths with '..' components.
Date: Fri, 01 Jul 2016 05:11:06 +0000	[thread overview]
Message-ID: <20160701051106.GA31422@tarsus.local2> (raw)
In-Reply-To: <160628074851.ZM26955@torch.brasslantern.com>

Bart Schaefer wrote on Tue, Jun 28, 2016 at 07:48:51 -0700:
> Therefore I think the only reasonable solutions are:
> (1) keep the current default and respect CHASE_DOTS to get the function
> Daniel wants, or
> (2) change the default and use :a:A to get the old behavior.
> 
> I lean slightly towards (1) but only because the doc has explicitly
> called out the "resolve .. first" behavior for the past 7 years.

What's the use-case for the "resolve '..' before symlinks" behaviour?

There doesn't seem to be a C stdlib function for it.

That behaviour (and the :A modifier) was added in 26731, but that thread
doesn't answer this question.

Was it an intentional design feature, or simply a documented bug?
(Honest question.)

> I floated the idea of testing CHASE_DOTS so that there would be a way
> to globally revert to the old behavior without having to update a lot
> of scripts, but I hadn't considered the "backward" semantics, and I'm
> not in favor of introducing a new option specifically for :A control.

(Perhaps instead of a new option, a new syntax; e.g., have $foo:A retain
its meaning and $foo:A:A have the new meaning.  Or make :A take an
optional argument.)

I get that a multitude of options is undesirable, and that making the
new behaviour conditional on an unset-by-default option helps
compatibility, but I'm wary of making a single option have two distinct
effects.

Each knob should do one thing and do it well.  Making chasedots affect
both 'cd' and :A will cause one of two things: either scripts that
'emulate -L zsh && setopt chasedots' for the setopt's effect on 'cd'
will get the new :A behaviour without explicitly opting in to it [which
seems to be your goal here], or people who wish :A to behave like
realpath(3) will have to use the chasedots version of 'cd'.

> However, with the current implementation there is NO way to obtain the
> semantics Daniel wants.

Thanks,

Daniel


  reply	other threads:[~2016-07-01  5:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 17:36 [PATCH 1/3] Tests: Add tests for the ':a' and ':A' modifiers Daniel Shahaf
2016-06-10 17:36 ` [PATCH 2/3] Fix the ':A' word modifier on paths with '..' components Daniel Shahaf
2016-06-10 18:54   ` Mikael Magnusson
2016-06-10 19:46     ` Bart Schaefer
2016-06-12 14:28       ` Daniel Shahaf
2016-06-12 16:49         ` Bart Schaefer
2016-06-13  8:52           ` Daniel Shahaf
2016-06-21  1:53             ` [PATCH v2 1/3] Tests: Add tests for the ':a' and ':A' modifiers Daniel Shahaf
2016-06-21  1:53               ` [PATCH v2 2/3] Fix the ':A' word modifier on paths with '..' components Daniel Shahaf
2016-06-21  3:08                 ` Mikael Magnusson
2016-06-25 16:28                   ` Daniel Shahaf
2016-06-25 16:47                     ` Mikael Magnusson
2016-06-27  0:20                       ` Daniel Shahaf
2016-06-28 14:48                         ` Bart Schaefer
2016-07-01  5:11                           ` Daniel Shahaf [this message]
2016-07-01 16:05                             ` Bart Schaefer
2016-07-03 20:20                               ` Peter Stephenson
2016-07-05  4:57                               ` Daniel Shahaf
2016-06-21  1:53               ` [PATCH v2 3/3] Clean up chabspath() [':a' word modifier] Daniel Shahaf
2016-06-10 17:36 ` [PATCH " Daniel Shahaf

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=20160701051106.GA31422@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).