From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Scott Chacon <schacon@gmail.com>
Subject: Re: What's cooking in git.git (Jan 2025, #05; Fri, 17)
Date: Sun, 19 Jan 2025 22:53:06 -0800 [thread overview]
Message-ID: <Z43y0mNhHsEdF22L@gmail.com> (raw)
In-Reply-To: <xmqqwmetgdgm.fsf@gitster.g>
On Fri, Jan 17, 2025 at 04:42:01PM -0800, Junio C Hamano wrote:
> * sc/help-autocorrect-one (2025-01-13) 1 commit
> - help: interpret boolean string values for help.autocorrect
>
> "[help] autocorrect = 1" used to be a way to say "please wait for
> 0.1 second after suggesting a typofix of the command name before
> running that command"; now it means "yes, if there is a plausible
> typofix for the command name, please run it immediately".
>
> Looking good except for "should 0 and false be 'tell it without doing it'?".
> source: <pull.1869.v4.git.git.1736760824201.gitgitgadget@gmail.com>
(The text below is from the original thread; sorry I don't have it handy
so I just replied here instead)
> ... but would it be simpler if we made it an extended boolean, i.e.
>
> true, yes, on, 1 -> same as "immediate"
> false, no, off, 0 -> same as "never"
> immediate -> same as what we currently do
> never -> same as what we currently do
> prompt -> same as what we currently do
> number -> same as what we currently do
I do think that, "0 -> same as never," makes a lot of sense from a
usability perspective.
On the other hand, I don't think that, "1 -> same as immediate," is a
very safe thing to do. One reason is that we should try to do the least
surprising thing possible, especially when the command may be something
that the user did not intend to run.
Recall that this topic was spun up because a value of "1" was
interpreted as 0.1 seconds, which is effectively the same as
"immediate." The original interpretation is arguably a usability issue
that is not improved by these changes.
I would instead recommend that, "1 -> same as prompt," would be a safer
and less surprising behavior. If the user wants "immediate" they can be
explicit about it. "immediate" is the most dangerous of all of these
options so adding ambiguous routes to it seems like a step backwards.
I don't really think backwards-compatibility is much of a concern here
at all. It *would* be a concern if we were moving from a safe behavior
to a less-safe behavior (like this patch currently does) but not so in
the other direction like I'm proposing by making "1" mean "prompt".
Do we think this is a valid assessment and worth changing?
If so I can try to whip up a quick patch over the existing state of
"seen" to change the behavior to "prompt" when "1" is seen and
"never" when "0" is seen.
--
David
next prev parent reply other threads:[~2025-01-20 6:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-18 0:42 What's cooking in git.git (Jan 2025, #05; Fri, 17) Junio C Hamano
2025-01-18 13:15 ` Jeff King
2025-01-18 17:17 ` Junio C Hamano
2025-01-19 12:51 ` Jeff King
2025-01-19 12:55 ` Jeff King
2025-01-21 19:17 ` Junio C Hamano
2025-01-20 6:53 ` David Aguilar [this message]
2025-01-20 7:54 ` [PATCH] help: make help.autocorrect = 1 the same as "prompt" David Aguilar
2025-01-21 19:23 ` What's cooking in git.git (Jan 2025, #05; Fri, 17) Junio C Hamano
2025-01-21 20:19 ` Derrick Stolee
2025-01-21 20:30 ` Junio C Hamano
2025-01-22 18:30 ` Taylor Blau
2025-01-22 22:13 ` Junio C Hamano
2025-01-23 23:05 ` Taylor Blau
2025-01-23 23:46 ` Junio C Hamano
2025-01-22 16:44 ` Karthik Nayak
2025-01-22 17:28 ` Karthik Nayak
2025-01-22 17:38 ` Junio C Hamano
2025-01-23 17:22 ` Junio C Hamano
2025-01-23 17:45 ` Patrick Steinhardt
2025-01-23 18:25 ` Junio C Hamano
2025-01-24 11:05 ` Karthik Nayak
2025-01-24 17:06 ` Junio C Hamano
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=Z43y0mNhHsEdF22L@gmail.com \
--to=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=schacon@gmail.com \
/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.
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).