zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 1/2] Set SAVEHIST to $HISTSIZE by default
Date: Tue, 6 Sep 2022 15:13:17 -0500	[thread overview]
Message-ID: <CAMP44s2LFaF5bOiXe6hQ6eH3LxRPXgP-gv6vC2wHa_Tqo303kQ@mail.gmail.com> (raw)
In-Reply-To: <CAMP44s3VBDyVHjjAc5p8+DEOiybVCFhAh_BYvFp5G0wnz4Mnww@mail.gmail.com>

On Fri, Sep 2, 2022 at 8:25 AM Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> On Fri, Sep 2, 2022 at 5:01 AM Daniel Shahaf <d.s@daniel.shahaf.name> 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 <d.s@daniel.shahaf.name> 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 <felipe.contreras@gmail.com>
> > > > > ---
> > > > >  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.

OK. Since I didn't get a reply to my arguments, I went ahead and
increased HISTSIZE first:

https://www.zsh.org/mla/workers/2022/msg00938.html

All my arguments should be more obvious now.

-- 
Felipe Contreras


  reply	other threads:[~2022-09-06 20:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  3:18 [PATCH 0/2] Useful default of HISTSIZE Felipe Contreras
2022-08-31  3:18 ` [PATCH 1/2] Set SAVEHIST to $HISTSIZE by default Felipe Contreras
2022-09-02  8:59   ` Daniel Shahaf
2022-09-02  9:29     ` Felipe Contreras
2022-09-02 10:01       ` Daniel Shahaf
2022-09-02 13:25         ` Felipe Contreras
2022-09-06 20:13           ` Felipe Contreras [this message]
2022-08-31  3:18 ` [PATCH 2/2] Increase default HISTSIZE to 1000 Felipe Contreras
2022-09-02  9:01   ` Daniel Shahaf
2022-09-02  9:49     ` Felipe Contreras
2022-08-31  3:39 ` [PATCH 0/2] Useful default of HISTSIZE Lawrence Velázquez
2022-08-31  5:57   ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s2LFaF5bOiXe6hQ6eH3LxRPXgP-gv6vC2wHa_Tqo303kQ@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).