zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] New :P history modifier.
Date: Wed, 17 Aug 2016 00:02:40 -0700	[thread overview]
Message-ID: <160817000240.ZM19759@torch.brasslantern.com> (raw)
In-Reply-To: <1471391679-9604-1-git-send-email-danielsh@tarsus.local2>

On Aug 16, 11:54pm, Daniel Shahaf wrote:
}
} WDYT?

The code changes are essentially OK; my only thought is, maybe we
should just remove the dependency on the POSIX realpath() call even
from :A, and use xsymlink() everywhere?

Picking at the docs ...

Given that we went to the trouble of hashing it out, it is probably
worth noting that :a is intended to result in the path to along which
"cd" would change under the default setopts (no_chase_dots), and :A
is meant to result in the physical directory at the end of that path.

} +	"a:absolute path, resolve '..' logically"
} +	"A:same, then resolve symlinks"
} +	"P:realpath, resolve '..' physically"

You should spell out what "same" means, because the two descriptions
may not always appear together.  I'm not sure "logical" and "physical"
are the right words here, but "by text replacement" and "by filesystem
reference" seem a bit too verbose, so I don't have a suggestion, just
calling attention.

(Aside:  The doc for "cd" doesn't ever describe how it behaves when
CHASE_DOTS is not set; the user is left to infer it from the doc that
explains what happens when CHASE_DOTS is set.)

} +The new word modifier ':P' computes the realpath() of the argument.
} +It is different from the existing ':a' modifier which does not resolve
} +symlinks, and from the existing ':A' modifier which always resolves
   ^^^^^^^^

If you're going to compare to both :a and :A, symlinks aren't the largest
difference vs. :a -- following ".." is.  In fact I'd say following ".."
is more important to the distinction than symlinks are.

} +/before/here/../after to /before/after --- even if /before/here is
} +a symbolic link.  It is recommended to review uses of ':A' and, if
} +appropriate, convert them to ':P' as soon as compatibility with 5.2 is
} +no longer a requirement.

So how about e.g.:

 The new word modifier ':P' computes the physical path of the argument.
 it is different from the existing ':a' modifier which does always
 resolves /before/here/../after to /before/after, and differs from the
 existing ':A' modifier which resolves symlinks only after here/.. is
 removed even when /before/here is itself a symbolic link.

That's all.


  reply	other threads:[~2016-08-17  7:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 23:54 Daniel Shahaf
2016-08-17  7:02 ` Bart Schaefer [this message]
2016-08-17 16:31   ` Daniel Shahaf
2016-08-17 17:06     ` Bart Schaefer
2016-08-18 16:55       ` 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=160817000240.ZM19759@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).