From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4613 invoked from network); 11 Sep 2020 16:10:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Sep 2020 16:10:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1599840626; b=Yy3KqCqAovHXQAE7AY6Z/jPWthgQ1IQDors57z0yVRvdCPo3VEfGajmQCNRRh981i8QN79BG7+ Dw5Z7YsAc4AkraOlI62EqFvSG9ftLD7gJEY0bq93CMnoRN4wejq9bwy5opHPlD0xpne/LCOfLe dfZ6Ytxim+wMGsPihde76KWjS80jQDE7VstlHjzCH5hfgQQJ/MR/ckPJYt4EZ5gYyHawkx/eKJ lZkg5u1ULlKaEG+UoZilXYVlZGNu/NqXoVao9304f6ihYGvAPNQhEm0wQ3BcbkcP3MY3uEO0hW t0e3wu76G4ju40MDQfZDjGTGd7NmnGR1Z07fUeu3H4BP0g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202008e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202008 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1599840626; bh=K7a4RmRqiDeRpbl6ikX3KO7Dghh3A31gNPeEX1b9qmA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=GFFue6gAA+W5+hS0a2v/XcF9eSjFK3PADLnXEKJdhuxWUSNnDKXtIkvfDu4ywKwloXAiJoMsc+ 7cfYQHtdI8HR69CKN+Cp3m5EX/m8t8/qccaS30AFc9OIubCHUI5CIqMlhKQPoz0YGtPsq5l4Hq w8s1sD9OqiCIjKYgfabrGFBnCU4y0C5RccBaTv1Trx7ADVwvQhzkYs9kliop883Km7EdRXZiNV wM5DN7mG71Aw+sa8IGl4xcWpu1T22+RzmwvLnEz9l6rHDf0DyK6nu0uEzsQX+GX4vPZADVWB0S 6Ovww5c/tZw+7SOxun8LlHaqF5zmzrHHlMdnAZ2YeQ58pw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=MlecJFIHms4YlYq2g2c8jTy79QRwHZkS52zkChBzFp0=; b=tZ/eIHkc7vyEaMew6AZoqp2hKC TfENmdOo4CBwYvf8Dzab2mi0CvVMZZTgrjJODMJW/wBP0ZxAilQivTTu/lf8k1v9Tas/fys2WPctq vyUp6jOzUQxGHiqaOgYiYswj8Op0zUP8/37oirye90b4HWyMMwOy0Q+Ti2ncmf04ndMA1htdBjF7v Hv2iU3iVSx/XNkr5wlFELCBV5/g5cWzDAvzQSKvThbwrt99WFyYzgwfrgQLHDswSz/Va320YnC6mI zO0/RzqizJ48xUrXr+r/m3vcY8+dY14l5MCno9Ww0CyRqAb+8TB2QZpXvxtYT3GQer42YULxl6i3g aE7zJkNw==; Received: from authenticated user by zero.zsh.org with local id 1kGld1-000IdB-Hd; Fri, 11 Sep 2020 16:10:23 +0000 Authentication-Results: zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202008e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202008 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none Received: from mx.spodhuis.org ([94.142.241.89]:25167) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kGlck-000IUn-8V; Fri, 11 Sep 2020 16:10:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202008; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Reply-To:Subject:Date:To: Cc:Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP: Organization; bh=MlecJFIHms4YlYq2g2c8jTy79QRwHZkS52zkChBzFp0=; t=1599840606; x=1601050206; b=CRocI2fPkMGWsiR6FPvt5iI53lUYEhrBqxCIa5en1pBr8xB9sPmNBhJ5mnVs +Ux87ti5bfjiZIXWkIRp6j9qXLNVwmmGx4bhSW/vi+fasV2WU5OVuu5x19uBfhYkN1pXKFd941go+ IOBdKF0z+FkWJEQaXB5gGtIpDKZ9KetyN4u4AbgFwH7526W0aotUK3NBjfSg0llotrHwvJOK00KOM XvfDVD3mgOZA95xO1lamHii1V/nw0xwwyjfpPTG3tHuFO4cz+bIGzT8LJAHL1Zj+hi8WREizwD9m0 GVLLHZq49mOHFE2KcRjWZ0RpCfa//HifYWQbPDIvvgT9vvGeIhA==; DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202008e2; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Reply-To:Subject:Date:To: Cc:Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP: Organization; bh=MlecJFIHms4YlYq2g2c8jTy79QRwHZkS52zkChBzFp0=; t=1599840606; x=1601050206; b=2PzDDtSePTFDuCFkwuOqsjz2/WgQLBBa6K2KwcTMal8JMdOvqBSenjW3jZZo xItqXsuyX5E8U0i7b/FM0oEyCQ==; Received: from authenticated user by smtp.spodhuis.org with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) id 1kGlci-000IUd-Il; Fri, 11 Sep 2020 16:10:04 +0000 Date: Fri, 11 Sep 2020 12:10:00 -0400 From: Phil Pennock To: Roman Perepelitsa Cc: Zsh hackers list Subject: Re: Possible bug: HASH_CMDS has no observable effect Message-ID: <20200911161000.GA1679994@fullerene.field.pennock-tech.net> References: <20200911144852.GA1669764@fullerene.field.pennock-tech.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/keys-2013rsa-2020cv25519.asc X-Seq: 47369 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On 2020-09-11 at 17:01 +0200, Roman Perepelitsa wrote: > Could you clarify how this statement is related to my bug report? Sure thing. You quoted documentation which also covered a combination not in effect, reported Zsh's behavior, and wrote: } I took this to mean that after installing rsync and invoking it, } ${commands[rsync]} will be set and running `hash` will display an } entry for rsync. This, however, is not the case. I explained the observed behavior, relative to the quoted documentation, and what was going on. > In case this wasn't clear, in my bug report the output of the > following two commands is not what I expect: > > # print $+commands[rsync] > 0 > # hash | grep rsync > # > > The expected output: > > # print $+commands[rsync] > 1 > # hash | grep rsync > rsync=/usr/bin/rsync > # > > The reason why I expect this output is because I've invoked rsync > right before these two commands while HASH_CMDS was in effect. There's two issues here, and it does look to me like the docs are out of date. Per the documentation, the first time you invoked `rsync`, an entry was added to the cache and thereafter when you invoked rsync, the cached entry was used. So the quoted examples don't make the documentation wrong. Except that's not what's going on, because even if rsync is installed before you first try to run it, the same thing happens. So it looks like zsh is preemptively building the command hash and not remembering when you do first run it. If you install rsync before first trying to access it, the docs imply that it should just work for you. Instead, you need to `rehash` first. Can anyone speak to whether we should change the documentation or the behavior? If the documentation, can someone who's not a maintainer suggest text which is sufficiently clear to them? -Phil