zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Jun-ichi Takimoto <takimoto_j@me.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] _ssh_hosts: abort early if in a path
Date: Wed, 29 May 2019 17:50:05 -0400	[thread overview]
Message-ID: <20190529215005.GA61620@phil-pennock> (raw)
In-Reply-To: <5F7BFA16-8F23-438C-A57B-1EB4E82757A4@me.com>

On 2019-05-29 at 22:57 +0900, Jun-ichi Takimoto wrote:
> > 2019/05/28 8:33、Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>のメール:
> > 
> > +case "$PREFIX" in
> > +  ( /* | ./* )
> > +    return
> > +    ;;
> > +esac
> 
> Isn't it better to "return 1"?

Doesn't seem to make any difference to the ssh family completions or to
git, but the docs seem to suggest that you're right, and `return 1` is
better.

> _ssh_hosts (before your patch) does not return 1 even if it can't 
> find any matches. Maybe better to fix this also?

If someone else wants to start an audit of the shipped completion
functions and their return statuses, then that's great.  Perhaps there's
some future optimizations which could be made if more of the completion
system cared about return codes.

But for me: the patch I offered (possibly modified to return 1) makes a
significant difference to performance and usability of zsh when copying
files between hosts.  That's the patch I'm offering for consideration:
small; simple to analyse; with clear results.

-Phil

      reply	other threads:[~2019-05-29 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 23:33 Phil Pennock
2019-05-29 13:57 ` Jun-ichi Takimoto
2019-05-29 21:50   ` Phil Pennock [this message]

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=20190529215005.GA61620@phil-pennock \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=takimoto_j@me.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).