Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _ssh_hosts: abort early if in a path
- X-seq: zsh-workers 44380
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Jun-ichi Takimoto <takimoto_j@xxxxxx>
- Subject: Re: [PATCH] _ssh_hosts: abort early if in a path
- Date: Wed, 29 May 2019 17:50:05 -0400
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201905; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TFJJs5TOw5fGZDhldSZ27n9eSdtJT5QAN3jybMlJxy8=; b=D8NZEcUUYbC5vHg44umz+rzq77 a5v/Q1IvgsJBLqG4Jz8NxxePEnUzQaBkeh9mttuldRUhAcRxeRHEtIVb5YenOE1FCdcRiHGTvZdN9 rLtuMEsH4uW9v+zLN7NLu/ijcDDZHmFOCTmfMfQFCFalGsnmtjxHj7hHOAIvEKjLxcCUr2qKhsD9/ l8auESIxJh3/CBuCLTpO4IOmFJXQUucPfY28ZVD7NlaQAl41LYsShjERm0IciDDv+Jbl252v4QXcz 8KkZqpyJzXIF6kfsLuUrZQXSg+scVjz2A/6NyrDv7BXym6RsI9Zpc6LxfmK+Jqmj4q3Gg/KEImFnz r4mFxIWQ==;
- Dkim-signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201905e2; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TFJJs5TOw5fGZDhldSZ27n9eSdtJT5QAN3jybMlJxy8=; b=aKUi9geBvqnLbhLLiEauTGgbYG 8tNnNcYgnHzzjc+9VQfScHA0GXnzS1a9nQFRQPFgkH4aApZkt6xyFavRkYDA==;
- In-reply-to: <5F7BFA16-8F23-438C-A57B-1EB4E82757A4@me.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc
- References: <20190527233331.GA84827@phil-pennock> <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@xxxxxxxxxxxx>のメール:
> >
> > +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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author