threads / discuss / 40034

feature request: better support for typos

Subject: feature request: better support for typos

## tl;dr

3 messages between Aug 7, 2015 and Aug 16, 2015.

replies: 2people: 3as markdown or json

Ralf Thielow· Aug 7, 2015, 18:12 UTC · lore
Hi,

when a user made a typo, Git is not good in guessing what the user could have meant, except for git commands. I think this is an area with room for improvements. Let's look into branches. When I "clone --branch" and make a typo, Git could show me what branch I could have meant. It's the same when I try to merge or track a branch. It might even be possible to show suggestions for options for all Git commands. What I'm trying to say is, there are arguments with a limited amount of possible values that Git know, so Git can show suggestions when the user made a typo for such an argument.

Ralf
Duy Nguyen· Aug 15, 2015, 09:12 UTC · re: Ralf Thielow · lore

Re: feature request: better support for typos

On Sat, Aug 8, 2015 at 1:12 AM, Ralf Thielow <ralf.thielow@gmail.com> wrote:
Show 8 quoted lines
> Hi,
>
> when a user made a typo, Git is not good in guessing what
> the user could have meant, except for git commands. I think
> this is an area with room for improvements.
> Let's look into branches. When I "clone --branch" and make
> a typo, Git could show me what branch I could have meant. It's
> the same when I try to merge or track a branch.
Good candidate for those micro-projects next year.
> It might even
> be possible to show suggestions for options for all Git commands.

You mean if you type "--brnch" it should suggest "--branch"? I was bugged about this and wanted to do something, only to realize in most cases git would show "git <cmd> -h", which does a much better job because it would explain what --branch is for as well.

> What I'm trying to say is, there are arguments with a limited
> amount of possible values that Git know, so Git can show
> suggestions when the user made a typo for such an argument.
-- 
Duy
Lawrence Siebert· Aug 16, 2015, 07:19 UTC · re: Duy Nguyen · lore

Re: feature request: better support for typos

I believe They mean that if you type "clone --branch mister", it should ask if you meant to "clone --branch master" instead, or something.

Basically if you type a non existent branch name, calculate edit distance for each branch name, probably either using a timeout or edit distance to stop if something is too different from any branch so you don't run for too long, and then, if a branch is within a certain edit distance from the typo, suggest it.

Lawrence
On Sat, Aug 15, 2015 at 2:12 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 29 quoted lines
> On Sat, Aug 8, 2015 at 1:12 AM, Ralf Thielow <ralf.thielow@gmail.com> wrote:
>> Hi,
>>
>> when a user made a typo, Git is not good in guessing what
>> the user could have meant, except for git commands. I think
>> this is an area with room for improvements.
>> Let's look into branches. When I "clone --branch" and make
>> a typo, Git could show me what branch I could have meant. It's
>> the same when I try to merge or track a branch.
>
> Good candidate for those micro-projects next year.
>
>> It might even
>> be possible to show suggestions for options for all Git commands.
>
> You mean if you type "--brnch" it should suggest "--branch"? I was
> bugged about this and wanted to do something, only to realize in most
> cases git would show "git <cmd> -h", which does a much better job
> because it would explain what --branch is for as well.
>
>> What I'm trying to say is, there are arguments with a limited
>> amount of possible values that Git know, so Git can show
>> suggestions when the user made a typo for such an argument.
> --
> Duy
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
About Me: http://about.me/lawrencesiebert
Constantly Coding: http://constantcoding.blogspot.com

← back to recent threads