From: "Mikael Magnusson" <mikachu@gmail.com>
To: "Alex Riesen" <raa.lkml@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
git@vger.kernel.org,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] git wrapper: DWIM mistyped commands
Date: Mon, 1 Sep 2008 16:42:44 +0200 [thread overview]
Message-ID: <237967ef0809010742w43de9e3dj28880de484e8c48d@mail.gmail.com> (raw)
In-Reply-To: <20080831135023.GA6616@blimp.local>
2008/8/31 Alex Riesen <raa.lkml@gmail.com>:
> From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
>
> This patch introduces a modified Damerau-Levenshtein algorithm into
> Git's code base, and uses it with the following penalties to show some
> similar commands when an unknown command was encountered:
>
> swap = 0, insertion = 1, substitution = 2, deletion = 4
>
> A typical output would now look like this:
>
> $ git sm
> git: 'sm' is not a git-command. See 'git --help'.
>
> Did you mean one of these?
> am
> rm
>
> The cut-off is at similarity rating 6, which was empirically determined
> to give sensible results.
>
> As a convenience, if there is only one candidate, Git continues under
> the assumption that the user mistyped it. Example:
>
> $ git reabse
> WARNING: You called a Git program named 'reabse', which does
> not exist.
> Continuing under the assumption that you meant 'rebase'
> [...]
> Mikael, this also might fix the crash you're seeing: the heap was
> corrupted by clean_cmdnames(&other_cmds) names members of which were
> moved to main_cmds.
It doesn't crash now, but the cut-off appears ineffective:
% git aaaaaaaaaaaaaaa
WARNING: You called a Git program named 'aaaaaaaaaaaaaaa', which does not exist.
Continuing under the assumption that you meant 'add--interactive'
in 2.0 seconds automatically...
By my estimate, that should have a score above 6 :).
--
Mikael Magnusson
next prev parent reply other threads:[~2008-09-01 14:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-28 17:15 [PATCH] Remove calculation of the longest command name from where it is not used Alex Riesen, Alex Riesen
2008-08-28 21:27 ` [PATCH updated] git wrapper: DWIM mistyped commands Alex Riesen
2008-08-28 21:28 ` [PATCH] Add help.autocorrect to enable/disable autocorrecting Alex Riesen
2008-08-29 10:11 ` Andreas Ericsson
2008-09-08 6:50 ` Junio C Hamano
2008-08-29 14:58 ` [PATCH updated] git wrapper: DWIM mistyped commands Mikael Magnusson
2008-08-30 10:12 ` Alex Riesen
2008-08-30 10:33 ` Mikael Magnusson
2008-08-31 13:50 ` [PATCH] " Alex Riesen
2008-08-31 13:54 ` [PATCH] Add help.autocorrect to enable/disable autocorrecting Alex Riesen
2008-08-31 14:49 ` Matthieu Moy
2008-08-31 16:33 ` Junio C Hamano
2008-09-01 14:42 ` Mikael Magnusson [this message]
2008-08-31 13:57 ` [PATCH updated] git wrapper: DWIM mistyped commands Alex Riesen
2008-08-30 15:36 ` Junio C Hamano
2008-08-30 16:44 ` Alex Riesen
2008-08-30 17:13 ` [PATCH] Reuse cmdname->len to store pre-calculated similarity indexes Alex Riesen
2008-08-30 17:26 ` Junio C Hamano
[not found] ` <a2075f4c0808301510g1af01b14kd58da12dc2e80f93@mail.gmail.com>
2008-08-30 22:17 ` [PATCH updated] git wrapper: DWIM mistyped commands Felipe Carvalho Oliveira
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=237967ef0809010742w43de9e3dj28880de484e8c48d@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=raa.lkml@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).