From: Jan Hudec <bulb@ucw.cz>
To: Andreas Ericsson <ae@op5.se>
Cc: Wincent Colaiuta <win@wincent.com>,
"Shawn O. Pearce" <spearce@spearce.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Jari Aalto <jari.aalto@cante.net>,
git@vger.kernel.org
Subject: Re: [PATCH] On error, do not list all commands, but point to --help option.
Date: Sun, 21 Oct 2007 15:13:51 +0200 [thread overview]
Message-ID: <20071021131351.GE8887@efreet.light.src> (raw)
In-Reply-To: <471B4931.5040102@op5.se>
[-- Attachment #1: Type: text/plain, Size: 1771 bytes --]
On Sun, Oct 21, 2007 at 14:42:25 +0200, Andreas Ericsson wrote:
> Wincent Colaiuta wrote:
>> El 21/10/2007, a las 4:06, Shawn O. Pearce escribió:
>>> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>>>>>> On Sat, 20 Oct 2007, Jari Aalto wrote:
>>>>>>
>>>>>>> - commented out call to list_common_cmds_help()
>>>>
>>>> Well, I'm almost sure of the opposite. One of the big results of the
>>>> Git
>>>> Survey was that git is still not user-friendly enough. Your patch would
>>>> only make this issue worse.
>>>
>>> Actually I think Jari's patch helps for the reason originally
>>> stated in the message (less output when you make a small typo).
>>> Though I agree that the commented out code should just be removed.
>>>
>>> I actually had to do `git config alias.upsh push` just to keep
>>> myself from screaming every time I made a small typo and Git gave
>>> me a screenful of "helpful reminders".
>> If you want to go really user friendly, how about a check against the list
>> of known commands using a shortest-edit distance algorithm?
>
> http://en.wikipedia.org/wiki/Levenshtein_distance
>
> Implementing the algorithm doesn't seem terribly difficult.
That's not the correct algorithm (you need to consider transpozitions, so you
need at least http://en.wikipedia.org/wiki/Damerau-Levenshtein_distance, but
I would not think that's the easier, or faster, way to do it. Though this
would have to be benchmarked -- calculating the edit distance is quadratic,
while generating the list of possibilities (and seeing whether they exist) is
linear, but with large constant. So the question is, whether we have few
enough commands that the quadratic calculation might be faster.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-10-21 13:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-20 8:24 [PATCH] On error, do not list all commands, but point to --help option Jari Aalto
2007-10-20 20:28 ` Johannes Schindelin
2007-10-20 22:28 ` Jari Aalto
2007-10-20 23:02 ` Johannes Schindelin
2007-10-21 2:06 ` Shawn O. Pearce
2007-10-21 3:24 ` Jeff King
2007-10-21 3:29 ` Shawn O. Pearce
2007-10-21 6:33 ` Yin Ping
2007-10-21 8:58 ` Wincent Colaiuta
2007-10-21 12:42 ` Andreas Ericsson
2007-10-21 13:13 ` Jan Hudec [this message]
2007-10-21 14:17 ` Andreas Ericsson
2007-10-24 0:28 ` Salikh Zakirov
2007-10-20 22:41 ` Jari Aalto
2007-10-21 3:33 ` Shawn O. Pearce
2007-10-21 10:09 ` Jan Hudec
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=20071021131351.GE8887@efreet.light.src \
--to=bulb@ucw.cz \
--cc=Johannes.Schindelin@gmx.de \
--cc=ae@op5.se \
--cc=git@vger.kernel.org \
--cc=jari.aalto@cante.net \
--cc=spearce@spearce.org \
--cc=win@wincent.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).