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=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11540 invoked from network); 12 Sep 2020 07:02:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Sep 2020 07:02:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1599894166; b=milcVqyoWWT7h7YpVSyuDBOF4IAPYGW3TuoUR2dFY9X4kBw3xp4y3r1kilZMVUbbT8nnF2HSVN HtUgi1LAduaQAZ/rzg+1JoNI/9JH6uLNaY2p87D6j7PAMh6L+Vg4+VgsoahaPkKDOHLE52lreG Pv52z8s253eeWhJYmO+/9zL/VsmU26ZbCvJTnENm0jubQufHdhmpVsMWqmBB/PXNYvifCPExgq IT3QyCUSKHKwnWUuDMpWMc6+OS0xz0PLZv1FkqzvgfAl6VkECCdL6i5wkAlQ86cj/P3GMijrBP I+N50idbA/LqhBcQi8iyhc78fteFoXPU/Nvey0bKHGANBA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-il1-f172.google.com) smtp.remote-ip=209.85.166.172; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1599894166; bh=ZnppaWFIPLssNkJ6zTcA7Ofxwyctx/b4Cyo1Uk4fsUc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=IqFuc4wM9osnnFFi1vIQxwV7dv/MEOrjn/Ua7fhI4l5odf6uW3vyk2XfH3l29TRW2h89Sf2NWx ydcv2ManegyLuLynrYpcy8V9wzRVo6s5sUOLeu/gLkx9NMmrzwiRLx5Sudpr34B6+ZP7MGZmna bbvLmnJdqtuRoTOBxHL46RytCMrH9IzgdMkSh6JH+1xjuTeKJHzpi7zQ3jmds1lyDElQ9d7667 Z8gANrd5eI0ZyeQODZPW9rR1FIDQfrAktu+tk0X3KthTYdhhU6gnCfxyddVWbEAf1nAKaW69I8 7h1v5RrdcthcQAA2vG3l2sKAZpRxVsXm4KE+SYTRtQoqfw==; 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:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=CkymZ4DIvwi7EMq6+T94irDsaJl7jfLM1C7HK8L6jYA=; b=1jYxWTy4AaHvY5NDPwwriVcA8c zL4dpnDZp8ysMFfoNgGhRJ6Wp3fGhI6g9Lv/FDx5AqqoaNUHO3WShXTXQYlWCSLqy0X03bU+XPK+G UWWY8n4GAVFBdrTnrMcxCAzkPfET8MqZhJFXiFU7e96np8/YjOJgTp1ZWlQxvQcUQiQjcnS99yywZ 8drDB0ZSXmKE263Y8g60JNz+AZMJv6XnSMUB7pbBxExDlntryOk/NA8AkW8PV9koyPARXzQd2WmL1 n9C5k1OSzOUaxCa7W2b+gldr76k/fNHmYK+SJAvEV1yNyOuTLTUCEjvLc5Xa7iM388LMRJGI8p0QF /xWWR1Xw==; Received: from authenticated user by zero.zsh.org with local id 1kGzYa-0002bL-9r; Sat, 12 Sep 2020 07:02:44 +0000 Authentication-Results: zsh.org; iprev=pass (mail-il1-f172.google.com) smtp.remote-ip=209.85.166.172; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-il1-f172.google.com ([209.85.166.172]:43141) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kGzYE-0002Rk-D6; Sat, 12 Sep 2020 07:02:23 +0000 Received: by mail-il1-f172.google.com with SMTP id a19so6442544ilq.10 for ; Sat, 12 Sep 2020 00:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CkymZ4DIvwi7EMq6+T94irDsaJl7jfLM1C7HK8L6jYA=; b=EgB+5XH0W1AeZ/fgk55dJBXmPF9HPNcq6DcFq8k9nrA32MRTPYqQe3opfGKsiRDSM3 4uE08yN/UQrfdzLlDTLY2mDOnKHCWWfXjWui1aUBxKfzX1limBFlqST4Np5YrQQbRIX3 pP6bw1jO8Yg5RZKLvrDsuSS/JFqWO2EvTpcrZ8TauYYBhwcZn/njap+KDbDKLc2Zfegu edjmFQt6QQ2doYi324G/eHe7fs4/1NCqeQe3Sei7fKwtUXkz6pavq9WAKKEInlOCoxxt 0jc6xhYi1CEhdyIknBwXbOhfDEmKDHuCznaxU60zUHsWM1xGjnsL8wrPgHbpK28FvtPr cJRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CkymZ4DIvwi7EMq6+T94irDsaJl7jfLM1C7HK8L6jYA=; b=od38+MutmbJ3Ky3gSNWMe17dBMcvcwkohzeyiT/kdFLsYJeU8QCGpZIxVjOjqFirQt PAewQ3qEXtBhhXzOPz1cw1mwEDiIUvEDJ0YDWygZ0nC9ZtJnnYsMW+stl3fDjuFPHG8T d04r4IAbxhRoln2VRGgEKcTom9F9/7FnrWKZqCgGkS5jrlZHoqpnJN2XO4kfJaErtlx9 mVjVia8UyYJyi1lrP9pXa7Gw+feEBnoWaCgtG0E/ac8LCzZqFsRHheYAorBhA8UAk3sp JFbzfm74h3I1I687XMW2oKko2ATqIrKbocw70UuAx9aEgZMxeiN/xpWQo2SX7NeGHJqG LX0w== X-Gm-Message-State: AOAM531R5Hdj4LmKzKO6PH+Sks4OgcxQvBNr3kgZ+45KMxWL7rRBx3Le DndMZDmxGz1waRYLwo7HDUi8XNyQrHAoBONWhiNJPCQ6n7e7QQ== X-Google-Smtp-Source: ABdhPJzRHF74vq1B6zknqfskM0JCMORvPnWI0Cr+AhC6Z1jlYUwL2GycuKyhxOiiJFmRle/6eLho9lcOc0eTxnsz4fc= X-Received: by 2002:a92:1a03:: with SMTP id a3mr4623103ila.304.1599894140259; Sat, 12 Sep 2020 00:02:20 -0700 (PDT) MIME-Version: 1.0 References: <20200911144852.GA1669764@fullerene.field.pennock-tech.net> <20200911161000.GA1679994@fullerene.field.pennock-tech.net> In-Reply-To: From: Roman Perepelitsa Date: Sat, 12 Sep 2020 09:02:09 +0200 Message-ID: Subject: Re: Possible bug: HASH_CMDS has no observable effect To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47372 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 Fri, Sep 11, 2020 at 11:10 PM Bart Schaefer wrote: > > On Fri, Sep 11, 2020 at 9:33 AM Roman Perepelitsa > wrote: > > > > Why isn't rsync hashed the first time it's executed? > > This is usually because of HASH_DIRS > [...] > If you unset HASH_DIRS you might get what you want. I can confirm that unsetting HASH_DIRS makes HASH_CMDS behave as I expect. That is, after a successful invocation of rsync, rsync=/usr/bin/rsync gets hashed. This implies that invoking any non-existing command with HASH_DIRS set effectively disables HASH_CMDS. The following test confirms it: % sudo docker run -e TERM -it --rm zshusers/zsh:5.8 # does-not-exist zsh: command not found: does-not-exist # apt-get update && apt-get install -y rsync # rsync rsync version 3.1.2 protocol version 31 # print $+commands[rsync] 0 Do I understand it correctly that this is working as intended? It appears to contradict the documentation for HASH_CMDS, which states that commands are hashed when they are invoked for the first time. Roman.