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, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12545 invoked from network); 2 Sep 2022 13:25:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 2 Sep 2022 13:25:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1662125150; b=NnttLOwlkBH7CKVrlpC7AWz8y7oJMRvXBUunmeGcxv1KKRmimT2mq9/ItWUB0+baW/22LOWscg he4xc8ECgOJ+qhgWCEVKTPMlSDTdwmUz/nHyCbJQ65ZupM/0zHkTQjyOmdDZyp8Fei1qOq/qF1 ct/hVfOtGQWzfb/zMN7oMQDzY2zmny7b9wzhIHyy6vDaZe3FRKOoVEGMo9C9nkkr9GfPbL3mI7 4+FOkcev+j6As+IJsTg1Nhj1tdC2Db3o/cz0VRc3bDy2SMwbQaU1erzEUdIABPw7LgHRzEbu1F E/8WErmqv7+w/kGE7R8zNGTCWZizMhp9ravR8TkuedeF9w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f52.google.com) smtp.remote-ip=209.85.218.52; dkim=pass header.d=gmail.com header.s=20210112 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-20210803; t=1662125150; bh=6ZJLnsvJw4rv4M5rry1zNdjg0XJErDuzQTHEb6ke2jk=; 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=jBQoQs8xKquz2ta1HrV56ysxe7UWUrg6M4GT60uaGlyO3VIh4kfySKO/AmFKrmLt6sdB6Gh2VZ H6+UKiEI9/pLQo6cDsklf1pV4QmvBH5JgbGNkBFNFBQJftEriJGPSmXTyo0D+0AzBP0PF54l6t TIRHoSGUPBtvQySQ0Rpd8MDoezOCJLiAY6JZLc2NWYzE338yXNMGUYBK6hMCN7qHWY58VSHn7E ZoKoNeeaCB6lZCfWRQaq1qcidRQmqiRLKGumcdKOOivAnTG4+usHYMGkCkO+UlOLgVAdN39+nQ 1kEKK2tsOOo84lE+cgV6v3Svh1KlscM8o4pmxE8I7nnD4Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; 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=CZfPANnMl+K/h9/H/A4KSrfdwjmrxgMtOV+q5AJ7hOE=; b=Mc0/QfrmUJXSaaBVmlF7iVlsoe L6hG6HdYd5QSkA5oIaYnO+ULTJd2j45kbN04LCY7HJfOfYm4iVaCBBI0j60fURz9vQbpnaaUxilwa bR//ixA/WZnljPRkR+uYDXVgRAkPxXyDPvgW3E2IGfLHAh3U8ZJUt+uby+sntdgDifTSLX1bdofDw g511IQfBOxju6ABk4w9zPmqi3kXovErRDwjlXUyvepYa8c0izMMlBDGVDkeZcZFdacDxYxQMi5QkT fSwbOw0BNbW06dkWpzrmdagWMx6JxRr11+gxBZbp1haZCSFeZN3VKUfB9qN63YGMBuurcKxfwXgSG 9zuZC1Vg==; Received: from authenticated user by zero.zsh.org with local id 1oU6gA-000CKZ-6s; Fri, 02 Sep 2022 13:25:50 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f52.google.com) smtp.remote-ip=209.85.218.52; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ej1-f52.google.com ([209.85.218.52]:46871) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oU6fq-000C0L-0d; Fri, 02 Sep 2022 13:25:30 +0000 Received: by mail-ej1-f52.google.com with SMTP id bj12so3814243ejb.13 for ; Fri, 02 Sep 2022 06:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=CZfPANnMl+K/h9/H/A4KSrfdwjmrxgMtOV+q5AJ7hOE=; b=lJcasi/5BTkdXabDi+1gGG95C2R0LSURgl1+qaR8IN3QczP9SyDZPlh700FsNlwoOr NNXHHaxYeBi8wykjrYUWNG6NE/aS/0hgAJgPnmjpksjkBIMw7C5rWtx2rPHSZiCMWabg LVbZdDxbxSotHB8hdIEIUm+vfCFP51n+H1GqY5xq+N7g0PuJ3WXXlwxuiuIxyhvXNXOU Dx/zGF7eoGShD1uviwMgGfGGrM7CQR4mDvTqK5cJFSBw5QG4uEzlLNMLQGYykh7sNnMX nXZYVMwVShO432xSeVteRHLv3e/BSXVLWDFCQD298Q/NUTqTaJ4TccC9mCqd9LxiS+u3 1vZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=CZfPANnMl+K/h9/H/A4KSrfdwjmrxgMtOV+q5AJ7hOE=; b=o4keEeuVgMGu0T24srpLVIKHRZEaxF2X8Rpdxtul5c6JstitUgsh6xpSinUN3v8iQa X9UIPl6UgAV5TK4UP3tRCH8Lzltxt+Fos/StkPNHWDQYQfPL2GhZT6NAuX67FG4j5rKy RrEmZ1i0lUJHGXg/QYr2GtDcQxVEpp2+UpIBAUpBOQH54npu4+hJuPkIP8kYhY3de/MT d7fl3KYBUwOWZ6t8928q3D4ZiGMCvLzRjT1U1XbMAXRDLDtwQM54wg7Fufd8VHP5JPmK L7bMgEoX6tWhih1qNOfM6F+vX4Q/5EdvFcwYezgY5/zVdtkzk70Fd5NCuBc1pnMJbLy7 DUww== X-Gm-Message-State: ACgBeo1Wlhxmxf+Vr7y1agU+LGc/25xC6bKDGt/jvypBe3KJ5l1XmZaE uV/iRcJ3RIOa4fk4+aXEN+i7Ab88W/oqslCLolh1uqxb2fyC8w== X-Google-Smtp-Source: AA6agR5kgD5VtEg4mEsKRfUWUFvPsSeblmEaxVrTEP0Pv/QDWNIyuo003xFT02AsKLlvtA9xgWiaRYmEzyVPiJpJwtQ= X-Received: by 2002:a17:907:b10:b0:73d:bedd:3121 with SMTP id h16-20020a1709070b1000b0073dbedd3121mr26353711ejl.530.1662125129461; Fri, 02 Sep 2022 06:25:29 -0700 (PDT) MIME-Version: 1.0 References: <20220831031854.27312-1-felipe.contreras@gmail.com> <20220831031854.27312-2-felipe.contreras@gmail.com> <20220902085904.GF5920@tarpaulin.shahaf.local2> <20220902100135.GL5920@tarpaulin.shahaf.local2> In-Reply-To: <20220902100135.GL5920@tarpaulin.shahaf.local2> From: Felipe Contreras Date: Fri, 2 Sep 2022 08:25:16 -0500 Message-ID: Subject: Re: [PATCH 1/2] Set SAVEHIST to $HISTSIZE by default To: Daniel Shahaf Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 50580 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: On Fri, Sep 2, 2022 at 5:01 AM Daniel Shahaf wrote: > Felipe Contreras wrote on Fri, Sep 02, 2022 at 04:29:30 -0500: > > On Fri, Sep 2, 2022 at 3:59 AM Daniel Shahaf wrote: > > > Felipe Contreras wrote on Tue, Aug 30, 2022 at 22:18:53 -0500: > > > > If they are the same, this makes it clearer that they are the same. > > > > > > > > Signed-off-by: Felipe Contreras > > > > --- > > > > Etc/FAQ.yo | 2 +- > > > > Functions/Newuser/zsh-newuser-install | 2 +- > > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo > > > > index 8c795685a..dd573767e 100644 > > > > --- a/Etc/FAQ.yo > > > > +++ b/Etc/FAQ.yo > > > > @@ -1631,7 +1631,7 @@ label(321) > > > > verb( > > > > HISTSIZE=200 > > > > HISTFILE=~/.zsh_history > > > > - SAVEHIST=200 > > > > + SAVEHIST=$HISTSIZE > > > > > > Personally, I'm not going to commit this since I find the increased > > > semantic precision / DRY compliance to be outweighed by the reduced > > > readability (both here and in the code below, but for different > > > reasons). > > > > But you only need to read it *once* and forget about it forever (or at > > least as long as you keep the same history strategy). > > You're summing over the wrong variable. This isn't jrandom's zshrc; > this is the FAQ. So, don't sum over how often jrandom will read this > passage of their zshrc, but over how often this part of the FAQ will be > read by existing and prospective users. First of all the text is wrong, setting HISTFILE is not necessary to save history, the default is 30, and that works fine. Now, let's imagine a world in which the text is fixed and HISTSIZE is not mentioned, what value do we recommend our users to set? By inertia we would do what we are currently doing, but there's a discrepancy: The simplest possibility is to set it to the same as tt($HISTSIZE) as above. Why is it the simplest possibility? Well, because if you have one next to the other, you can simply set both to the same value. But now that's not true, because we don't have the value of HISTSIZE at hand. We could explain what is the default value of HISTSIZE, and recommend the users to set that, but it's 30, which is not very useful, we would want something at least the current recommended value, so this works: HISTFILE=~/.zsh_history SAVEHIST=200 But what happens if the default value of HISTSIZE is increased? (as it happens in patch 2) If the value is bigger than 200, it will basically be ignored, so if the new HISTSIZE is 1000, you potentially could lose 800 entries. Therefore the usefulness of the new default is lost. And what happens in the year 2050 when computers have 8 TB of RAM and we decide our users can probably afford a default HISTSIZE of 10000? Are we going to update the FAQ yet again? Are we going to recommend users to increase the SAVEHIST accordingly? None of this is *necessary* for what the objective of the text initially was, which is to explain why the history is not being saved. The answer is simple: the history is not saved because SAVEHIST isn't set and the simplest way to set it is to $HISTSIZE. There is no need to care what the value of HISTSIZE is, or whether the user sets it or not, setting SAVEHIST to $HISTSIZE just works, now and forever. -- Felipe Contreras