From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=DKIM_ADSP_ALL,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 449f2bfc for ; Wed, 29 May 2019 21:51:04 +0000 (UTC) Received: (qmail 2518 invoked by alias); 29 May 2019 21:50:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44380 Received: (qmail 9132 invoked by uid 1010); 29 May 2019 21:50:50 -0000 X-Qmail-Scanner-Diagnostics: from mx.spodhuis.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25461. spamassassin: 3.4.2. Clear:RC:0(94.142.241.89):SA:0(-4.3/5.0):. Processed in 1.895842 secs); 29 May 2019 21:50:50 -0000 X-Envelope-From: zsh-workers+phil.pennock@spodhuis.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spodhuis.org designates 94.142.241.89 as permitted sender) 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==; Date: Wed, 29 May 2019 17:50:05 -0400 From: Phil Pennock To: Jun-ichi Takimoto Cc: zsh-workers@zsh.org Subject: Re: [PATCH] _ssh_hosts: abort early if in a path Message-ID: <20190529215005.GA61620@phil-pennock> References: <20190527233331.GA84827@phil-pennock> <5F7BFA16-8F23-438C-A57B-1EB4E82757A4@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5F7BFA16-8F23-438C-A57B-1EB4E82757A4@me.com> OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc On 2019-05-29 at 22:57 +0900, Jun-ichi Takimoto wrote: > > 2019/05/28 8:33、Phil Pennock のメール: > > > > +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