From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: zsh-workers@zsh.org
Subject: [PATCH] Functions/Misc/relative: use -q with cd
Date: Thu, 27 Apr 2017 22:35:37 +0200 [thread overview]
Message-ID: <20170427203537.13535-1-genml+zsh-workers@thequod.de> (raw)
From: Daniel Hahler <git@thequod.de>
This skips chpwd function(s), which only add overhead and might cause
unwanted side-effects.
---
Functions/Misc/relative | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Functions/Misc/relative b/Functions/Misc/relative
index 432f2e2da..db3b5a587 100644
--- a/Functions/Misc/relative
+++ b/Functions/Misc/relative
@@ -8,8 +8,8 @@ emulate -L zsh || return 1
[[ $1 -ef $2 ]] && print ${3:-.} && return
# The simplest way to eliminate symlinks and ./ and ../ in the paths:
-1=$(cd $1; pwd -r)
-2=$(cd $2; pwd -r)
+1=$(cd -q $1; pwd -r)
+2=$(cd -q $2; pwd -r)
local -a cur abs
cur=(${(s:/:)2}) # Split 'current' directory into cur
--
2.12.2
next reply other threads:[~2017-04-27 20:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-27 20:35 Daniel Hahler [this message]
2017-04-29 17:07 ` Daniel Shahaf
2017-04-29 19:47 ` Bart Schaefer
2017-06-22 20:32 ` Daniel Hahler
2017-06-22 23:39 ` Bart Schaefer
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=20170427203537.13535-1-genml+zsh-workers@thequod.de \
--to=genml+zsh-workers@thequod.de \
--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).