git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] help: add prompt-yes setting for autocorrect

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Jan 15, 2025, 09:51 UTC
Message-ID
<1c220376-4b4b-425f-9797-abd1728aacc2@app.fastmail.com>
In-Reply-To
<pull.1852.git.1736933815236.gitgitgadget@gmail.com>
On Wed, Jan 15, 2025, at 10:36, Chris Howlett via GitGitGadget wrote:
Show 22 quoted lines
> From: Chris Howlett <chowlett09@gmail.com>
>
> The help.autocorrect functionality is really useful, saving frustration
> when a dev fat-fingers a command, and git has a pretty good idea what
> was originally intended. The config settings are a nice selection, with
> "prompt" asking the user to confirm that they want to run the assumed
> command.
>
> However, with "prompt", the choice defaults to "No" - that is, hitting
> return will _not_ run the command. For me at least, if git is confident
> it knows which command I wanted, it's usually right, and the golden path
> would be to run the command.
>
> Therefore this patch adds "prompt-yes" as a counterpart config setting
> for help.autocorrect, which does the same as "prompt", but defaults to
> "Yes" - hitting return will run the assumed command.
>
> I have not added any tests because the test suite doesn't have any tests
> (that I could find) for the "prompt" behaviour - I'm assuming this is
> because it's hard/impossible to simulate the interactive terminal prompt
>
> Signed-off-by: Chris Howlett <chowlett09@gmail.com>

This seems to conflict with the patch “help: interpret boolean string values for help.autocorrect” which is in `seen`. The latest version (I don’t know what version is applied right now):

https://lore.kernel.org/git/pull.1869.v4.git.git.1736760824201.gitgitgadget@gmail.com/
Previous: Chris Howlett via GitGitGadgetNext: Chris Howlett
Message 2 of 7 in “help: add prompt-yes setting for autocorrect”
  1. help: add prompt-yes setting for autocorrectChris Howlett via GitGitGadget, Jan 15, 2025
  2. Kristoffer HaugsbakkJan 15, 2025
  3. Chris HowlettJan 15, 2025
  4. Kristoffer HaugsbakkJan 15, 2025
  5. help: add prompt-yes setting for autocorrectChris Howlett via GitGitGadget, Feb 17, 2025
  6. Chris HowlettMar 4, 2025
  7. Junio C HamanoMar 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.