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

Re: [PATCH] help: prompt user to run corrected command on typo

From
Justin Tobler <jltobler@gmail.com>
Date
Jun 18, 2026, 17:48 UTC
Message-ID
<ajQuqTB580gqNP8D@denethor>
In-Reply-To
<6a340006.60da1a74.20db39.8f57@mx.google.com>
On 26/06/18 07:26AM, calicomills wrote:
Show 18 quoted lines
> From 0dc9e5c4593611b75e7003e8fdbea9370524c05b Mon Sep 17 00:00:00 2001
> From: calicomills <jishnuck26@gmail.com>
> Date: Thu, 18 Jun 2026 19:47:12 +0530
> Subject: [PATCH] help: prompt user to run corrected command on typo
> 
> When a user mistypes a git command and there is exactly one similar
> command, git currently prints a suggestion but exits, requiring the
> user to retype the corrected command manually.
> 
> Instead, when stdin and stderr are both connected to a terminal and
> there is a single best match, prompt the user with:
> 
>   Did you mean 'git checkout neo'? [y/N]
> 
> The full corrected invocation (command + original arguments) is shown
> in the prompt so the user knows exactly what will run. Answering 'y'
> re-executes git with the corrected command and all original arguments.
> Answering anything else exits as before.

Isn't this already possible via setting `help.autoCorrect=prompt` in the config? For example:

  git -c help.autoCorrect=prompt comit --allow-empty -m init
seems to already do exactly what is proposed here.
-Justin
Previous: calicomillsNext: Jishnu C K
Message 2 of 8 in “help: prompt user to run corrected command on typo”
  1. help: prompt user to run corrected command on typocalicomills, Jun 18, 2026
  2. Justin ToblerJun 18, 2026
  3. Jishnu C KJun 19, 2026
  4. Justin ToblerJun 19, 2026
  5. Junio C HamanoJun 19, 2026
  6. help: include arguments in autocorrect=prompt messageJishnu C K, Jun 19, 2026
  7. Jishnu C KJun 23, 2026
  8. Junio C HamanoJun 23, 2026

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.