Re: [PATCH 4/4] allow recovery from command name typos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Sun, May 6, 2012 at 4:21 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Sun, May 06, 2012 at 02:55:30PM +0800, Tay Ray Chuan wrote:
>
>> 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

While I agree there should be a config to protect this, I was hoping
this would be useful to users on the terminal who make the occasional
slip-up, without having to do any prior configuration.

-- 
Cheers,
Ray Chuan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Newbies FAQ]     [Linux Kernel Development]     [Free Online Dating]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Free Online Dating]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]     [Linux Resources]

Add to Google