threads / discuss / 30680

More use of levenshtein?

Subject: More use of levenshtein?

## tl;dr

4 messages between Jun 1, 2012 and Jun 2, 2012.

replies: 3people: 3as markdown or json

Junio C Hamano· Jun 1, 2012, 19:04 UTC · lore
Perhaps we could go one step further when we issue this error message?
  $ git checkout -b jc/ls-files-i-dir maitn-1.7.8
  fatal: git checkout: updating paths is incompatible with switching branches.
  Did you intend to checkout 'maitn-1.7.8' which can not be resolved as commit?
Yes, I do have maint-1.7.8 branch in my private repository.
Nguyen Thai Ngoc Duy· Jun 2, 2012, 10:26 UTC · re: Junio C Hamano · lore

Re: More use of levenshtein?

On Sat, Jun 2, 2012 at 2:04 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> Perhaps we could go one step further when we issue this error message?
>
>  $ git checkout -b jc/ls-files-i-dir maitn-1.7.8
>  fatal: git checkout: updating paths is incompatible with switching branches.
>  Did you intend to checkout 'maitn-1.7.8' which can not be resolved as commit?
Yes, please. Also to correct misspelled option names.

In case there are more than one candidate, we should print extra info (for commands or options, it's one line description; for refs, probably commit subject line)

-- 
Duy
David Michael Barr· Jun 2, 2012, 11:37 UTC · re: Nguyen Thai Ngoc Duy · lore

Re: More use of levenshtein?

On Sat, Jun 2, 2012 at 8:26 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
Show 12 quoted lines
> On Sat, Jun 2, 2012 at 2:04 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Perhaps we could go one step further when we issue this error message?
>>
>>  $ git checkout -b jc/ls-files-i-dir maitn-1.7.8
>>  fatal: git checkout: updating paths is incompatible with switching branches.
>>  Did you intend to checkout 'maitn-1.7.8' which can not be resolved as commit?
>
> Yes, please. Also to correct misspelled option names.
>
> In case there are more than one candidate, we should print extra info
> (for commands or options, it's one line description; for refs,
> probably commit subject line)

This and a functional implementation of "help.autocorrect = prompt." I think we now have the bits and pieces to do it right.

-- David Barr

Junio C Hamano· Jun 2, 2012, 22:55 UTC · re: Nguyen Thai Ngoc Duy · lore

Re: More use of levenshtein?

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 5 quoted lines
> Yes, please. Also to correct misspelled option names.
>
> In case there are more than one candidate, we should print extra info
> (for commands or options, it's one line description; for refs,
> probably commit subject line)

I do not think either is a good idea. We are talking about "typo", the user knew what he wanted, just didn't spell it correctly.

← back to recent threads