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