From: Lawrence Siebert <lawrencesiebert@gmail.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Ralf Thielow <ralf.thielow@gmail.com>, git <git@vger.kernel.org>
Subject: Re: feature request: better support for typos
Date: Sun, 16 Aug 2015 00:19:48 -0700 [thread overview]
Message-ID: <CAKDoJU7qx7xuzc5X4zJE6-9wvr9dB_h-_u0gYZN9p7ORK-u_mw@mail.gmail.com> (raw)
In-Reply-To: <CACsJy8DGUo0-zFm2xtAKE6wy0c2GdbiOe-X2+B0HnCNg3SKa8g@mail.gmail.com>
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:
> 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
prev parent reply other threads:[~2015-08-16 7:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 18:12 feature request: better support for typos Ralf Thielow
2015-08-15 9:12 ` Duy Nguyen
2015-08-16 7:19 ` Lawrence Siebert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKDoJU7qx7xuzc5X4zJE6-9wvr9dB_h-_u0gYZN9p7ORK-u_mw@mail.gmail.com \
--to=lawrencesiebert@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=ralf.thielow@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).