Re: [PATCH 4/4] allow recovery from command name typos
- From
Jeff King <peff@peff.net>
- Date
- May 6, 2012, 08:21 UTC
- Message-ID
- <20120506082130.GB27878@sigill.intra.peff.net>
- In-Reply-To
- <1336287330-7215-5-git-send-email-rctay89@gmail.com>
On Sun, May 06, 2012 at 02:55:30PM +0800, Tay Ray Chuan wrote:
Show 21 quoted lines
> If suggestions are available (based on Levenshtein distance) and if the > terminal isatty(), present a prompt to the user to select one of the > computed suggestions. > > In the case where there is a single suggestion, present the prompt > "[Y/n]", such that "", "y" and "Y" as input leads git to proceed > executing the suggestion, while everything else (possibly "n") leads git > to terminate. > > In the case where there are multiple suggestions, number the suggestions > 1 to n, and accept as input one of the numbers, while everything else > (possibly "n") leads git to terminate. In this case there is no default; > that is, an empty input leads git to terminate. A sample run: > > $ git sh --pretty=oneline > git: 'sh' is not a git command. See 'git --help'. > > Did you mean one of these? > 1: show > 2: push > [1/2/.../n] 1
Ugh. Please protect this with a config variable that defaults to "off". It is very un-Unix to prompt unexpectedly, and I suspect a lot of people would be annoyed by this behavior changing by default (I know I would be).
-Peff