zsh-users
 help / color / mirror / code / Atom feed
From: Roland Eggner <edvz2@systemanalysen.net>
To: zsh-users@zsh.org
Subject: Re: realpath(3), symlinks, '..' components, and the ':A' word modifier
Date: Tue, 5 Jul 2016 14:54:30 +0200	[thread overview]
Message-ID: <20160705125430.GA29959@mobil.systemanalysen.net> (raw)
In-Reply-To: <20160705045756.GC11492@tarsus.local2>

[-- Attachment #1: Type: text/plain, Size: 1742 bytes --]

On 2016-07-05 Tuesday at 04:57 +0000 Daniel Shahaf wrote:
> Feedback is sought for a proposed behaviour change to the shell.
> 
> Currently, the ':a' word modifier removes '..' component from a path —
> using a purely syntactic transformation, i.e., without consulting the
> filesystem at all — and ':A' does the same and then resolves symlinks
> [so no path component in the result is a symlink].
> 
> It has been proposed to change the semantics of :A to resolve symlinks
> first and '..' components second, like the realpath(3) library function
> does.
> 
> Under the incumbent semantics, $foo:A denotes the same file as $foo:a
> (but not necessarily the same file as $foo).  Under the proposed
> semantics, $foo:A denotes the same file as $foo (but not necesarily the
> same file as $foo:a).
> 
> Would this change be a good idea?
> 

If voting for two different solutions is permitted,
I would vote for either (1) or (2):


(1)
(1.1)  We have already modifier “:a” for “..” removal.
(1.2)  Introduce a new modifier just for resolving
       filereferences (“symlinks”).
By splitting the two actions of modifier “:A” we could have both,
(1.2) after or before (1.1), both with the performance advantage over
external “realpath”.  The need to think about the desired order would
automatically comply with the goal of “least surprise”.

(2)    Leave it as is, keep backward compatibility.
The inconsistency with “realpath” can be viewed as advantage:
Both (1.2) after or before (1.1) is possible, the former by using “:A”,
the latter by using external “realpath”.



Thanks for taking care and for this democratic approach.
-- 
Best regards
Roland Eggner

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

  reply	other threads:[~2016-07-05 13:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05  4:57 Daniel Shahaf
2016-07-05 12:54 ` Roland Eggner [this message]
2016-07-05 13:24 ` Vadim Zeitlin
2016-07-06 15:15   ` Filipe
     [not found] ` <20160705125430.GA29959__3886.85245202414$1467723835$gmane$org@mobil.systemanalysen.net>
2016-07-07  2:00   ` Daniel Shahaf
2016-07-07 17:20     ` Bart Schaefer
     [not found]       ` <20160705093321.79d7c4bc@pwslap01u.europe.root.pri>
2016-07-12  7:58         ` Next release (5.3) Roman Neuhauser
2016-07-12 16:40           ` Bart Schaefer
2016-07-12 20:23             ` Oliver Kiddle
2016-07-13  2:56               ` Filipe Silva
2016-07-13  4:45                 ` Bart Schaefer
2016-07-13  5:09                   ` Filipe Silva
2016-07-13  9:32               ` Peter Stephenson
2016-07-13  9:59                 ` Peter Stephenson
2016-07-13 16:35                   ` Bart Schaefer
2016-07-13 16:59                     ` Peter Stephenson
2016-07-13 17:50                       ` Bart Schaefer
     [not found]                 ` <20160713105910.2b33701c__17004.846657119$1468404086$gmane$org@pwslap01u.europe.root.pri>
2016-07-17 14:59                   ` Daniel Shahaf
     [not found]               ` <20160713103233.14bfd05a__26126.9551389434$1468402471$gmane$org@pwslap01u.europe.root.pri>
2016-07-17 14:59                 ` [PATCH] improve :A docs (was: Re: Next release (5.3)) Daniel Shahaf
     [not found]                 ` <20160717145931.GA4859__10178.6871244714$1468767679$gmane$org@tarsus.local2>
2016-07-20  6:54                   ` Daniel Shahaf
2016-07-13  7:41             ` Next release (5.3) Roman Neuhauser
2016-07-13 17:36               ` Bart Schaefer
2016-07-20 13:05             ` Vincent Lefevre
2016-07-20 14:00               ` Vincent Lefevre
2016-07-20 14:15                 ` Peter Stephenson
2016-07-20 14:19                   ` Peter Stephenson
     [not found]                 ` <20160720151517.6a833f2c__37436.2382958227$1469024822$gmane$org@pwslap01u.europe.root.pri>
2016-07-21  5:40                   ` Daniel Shahaf
2016-07-21  9:19                     ` Peter Stephenson
2016-07-21  3:50               ` Bart Schaefer
     [not found]           ` <160712094017.ZM17395__33553.1437922784$1468341719$gmane$org@torch.brasslantern.com>
2016-07-13  5:00             ` Daniel Shahaf
     [not found]       ` <20160712075849.GG1537__20664.8654224866$1468310440$gmane$org@isis.sigpipe.cz>
2016-07-13  5:01         ` Daniel Shahaf
2016-07-20 12:44       ` realpath(3), symlinks, '..' components, and the ':A' word modifier Vincent Lefevre

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=20160705125430.GA29959@mobil.systemanalysen.net \
    --to=edvz2@systemanalysen.net \
    --cc=zsh-users@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).