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

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

 



Thomas Rast <trast@xxxxxxxxxxxxxxx> writes:

> We already have help.autocorrect.  It defaults to 0, which results in
>
>   $ g rebest
>   git: 'rebest' is not a git command. See 'git --help'.
>   
>   Did you mean one of these?
>           rebase
>           reset
>           revert
>
> But it can also be a timeout in deciseconds, after which the match is
> automatically executed (if there is only one).  You could hijack it by
>
> * making 'ask' mean your new feature
>
> * making 'off' etc. be the same as 0 for sanity
>
> * making the default value be like 0, but with an extra message such as
>
>     Use 'git config --global help.autocorrect ask' to let me prompt for
>     the correct command.
>
>   though I'm sure you can improve on the wording.

Sounds good.

By the way, does anybody actually use the deciseconds grace period to ^C
the process?  I know I was the guilty party for suggesting it, but it
strikes me that it is rather a dangerous option.  When checking out
another branch with great difference with "git chekcout foo", you would be
asked "did you mean checkout?", and if you hit ^C a bit too late, you may
not kill autocorrect but end up killing a lengthy "checkout" in the
middle, messing up the working tree with a mixture of files in old and new
branches, needing a "reset --hard" to recover.  We might want to update
the documentation to warn about this, even though I personally do not
think it is worth removing the support (and going through the trouble of
having to deal with "why did you remove the useful feature" complaints).

--
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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]