From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24022 invoked by alias); 6 Jul 2016 15:15:57 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21736 Received: (qmail 10106 invoked from network); 6 Jul 2016 15:15:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MIME_QP_LONG_LINE,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eposZstOB+R5VeRS7oWIwSgw3V1aVWs7ruhpsj1Ik5g=; b=so20Th1pZMsM6cJ4V08JOH0VzBoeWoGeSRiL6g6ey/T30QCX/jjOf4jNolUR+PupZg yCTTtXdmOAbg6HSbHk10xu3BFUQSHIaZUYq1kZ5t7UdNtrnsFt/ZXAM+R3JX/eFXL6qx 3840urdEO3BAlk9ZCzN6AH26ZPcIPx4K98iXfnDjkT0hAa+260vkoMZHldCpwySfGabo dbVHBL42F4u2J14IMrK+2KRrHePdbXye+1eaYBOHejUtPYLmuuAGQuUP0FBJ802KuYn1 9xSiE+3nil8Y+iVbBskO8cQ2s4GiRLb8V3GozEPC6KWeO7ccW/Qq+opMelHUKsb5iamU rxvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eposZstOB+R5VeRS7oWIwSgw3V1aVWs7ruhpsj1Ik5g=; b=IfYA/5QV3HOiJzjMcl3ixW/Ms2WVsHI9UEfFz739bEyKQLjcu7oL1lmb8xfn86IfXd sBtSjv1g/wZHg/70G09ztA1b8znaELOHt7vTM7LzvV7jeio7ZyS4pt1SXknsFjEIxodL ST5qUkkDvc7A6q4GGq9j2Vk/deGremfeJHlemi0c4ikiZJ4D73TDbVNWR5ZdScwwxOlX jCHsvUPtISG0w8cZ9ioXGa7jBTL4RgOViXzFLg8RziNqO1+A+tPyIR0quUzz7xqdxdPN MAEqdLUusIAz7W/axRYCLEmJJf57iHUH/CYeyqYNZ8Mehelv0jRzs/NEWy33Hum0q8ei 1aeA== X-Gm-Message-State: ALyK8tJcmiePHnQamYNV942rp2dHDBt52f7kxOl7KN0o21rH32sKn6oeQj26+eu80ZPwYw== X-Received: by 10.237.34.213 with SMTP id q21mr35681808qtc.53.1467818152086; Wed, 06 Jul 2016 08:15:52 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: realpath(3), symlinks, '..' components, and the ':A' word modifier From: Filipe X-Mailer: iPhone Mail (13C75) In-Reply-To: Date: Wed, 6 Jul 2016 12:15:48 -0300 Cc: zsh-users@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <5CA755C6-9CBA-4FE2-A31F-9C3DAD53EA41@gmail.com> References: <20160705045756.GC11492@tarsus.local2> To: Vadim Zeitlin having a script broken by upgrading is such a painful, awful experience. Couldn't we create another modifier that behaves like realpath? e.g. (:Ar) o= r even add an option to trigger this realpath compatible behaviour?=20 > On 5 de jul de 2016, at 10:24, Vadim Zeitlin wrote: >=20 > On Tue, 05 Jul 2016 04:57:56 +0000 Daniel Shahaf w= rote: >=20 > DS> Feedback is sought for a proposed behaviour change to the shell. > DS>=20 > DS> Currently, the ':a' word modifier removes '..' component from a path =E2= =80=94 > DS> using a purely syntactic transformation, i.e., without consulting the > DS> filesystem at all =E2=80=94 and ':A' does the same and then resolves s= ymlinks > DS> [so no path component in the result is a symlink]. > DS>=20 > DS> It has been proposed to change the semantics of :A to resolve symlinks= > DS> first and '..' components second, like the realpath(3) library functio= n > DS> does. > DS>=20 > DS> Under the incumbent semantics, $foo:A denotes the same file as $foo:a > DS> (but not necessarily the same file as $foo). Under the proposed > DS> semantics, $foo:A denotes the same file as $foo (but not necesarily th= e > DS> same file as $foo:a). > DS>=20 > DS> Would this change be a good idea? >=20 > Hello, >=20 > I am not sure why would this be a good idea, the only argument for it I > see is compatibility with realpath(), but how much does it really matter? > There would seem to be quite a few flags/modifiers not corresponding to an= y > C library functions, so this doesn't seem like such an egregious exception= . >=20 > But this change would be backwards incompatible, if only marginally, and > my personal test for making breaking changes is whether I could see myself= > justifying them reasonably well to someone whose script has got broken > after updating the shell. If you imagine yourself in such a situation, wha= t > would your explanation be? I don't think that "we decided to make it > compatible with realpath(3)" quite cuts it. But this is just my personal > opinion, of course (and, FWIW, I don't think I personally have any script > which could be broken by this change anyhow). >=20 > Regards, > VZ