# More use of levenshtein?

4 messages from 2012-06-01 to 2012-06-02. Participants: Junio C Hamano, Nguyen Thai Ngoc Duy, David Michael Barr.
Thread: https://gitlist.dev/t/30680

## Junio C Hamano, 2012-06-01 19:04

Subject: More use of levenshtein?
Message-ID: <7vzk8m26sf.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzk8m26sf.fsf%40alter.siamese.dyndns.org

```
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, 2012-06-02 10:26

Subject: Re: More use of levenshtein?
Message-ID: <CACsJy8DuDzxrcb8kbWhH9N=1APQeEOUZzUvSaKCJ7LJ9rc9tKg@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8DuDzxrcb8kbWhH9N%3D1APQeEOUZzUvSaKCJ7LJ9rc9tKg%40mail.gmail.com
In-Reply-To: <7vzk8m26sf.fsf@alter.siamese.dyndns.org>

```
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)
-- 
Duy

```

## David Michael Barr, 2012-06-02 11:37

Subject: Re: More use of levenshtein?
Message-ID: <CAFfmPPPi92zN7QOh4q=rcVBb0oEFa3LKKdURe5gGj02_dEHoMA@mail.gmail.com>
URL: https://gitlist.dev/e/CAFfmPPPi92zN7QOh4q%3DrcVBb0oEFa3LKKdURe5gGj02_dEHoMA%40mail.gmail.com
In-Reply-To: <CACsJy8DuDzxrcb8kbWhH9N=1APQeEOUZzUvSaKCJ7LJ9rc9tKg@mail.gmail.com>

```
On Sat, Jun 2, 2012 at 8:26 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> 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, 2012-06-02 22:55

Subject: Re: More use of levenshtein?
Message-ID: <7vvcj9z5l5.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vvcj9z5l5.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CACsJy8DuDzxrcb8kbWhH9N=1APQeEOUZzUvSaKCJ7LJ9rc9tKg@mail.gmail.com>

```
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

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

```
