Thread (16 messages) flat view 16 messages, 7 authors, 2016-06-15

Re: [TOY PATCH] git wrapper: show similar command names for an unknown command

From: Dirk Süsserott <hidden>
Date: 2016-06-15 22:44:41

Johannes Schindelin schrieb:
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 reabse
	git: 'reabse' is not a git-command. See 'git --help'.

	Did you mean one of these?
		rebase
		merge-base
		rev-parse
		remote
		rerere

Signed-off-by: Johannes Schindelin <redacted>
---
	This is just a toy, but might be useful to other people.

  
[snip]

Whow! This is really cool, especially for people that do not know the
different commands by heart -- like me. I often know there's a
command that's spelled somehow like X but I don't exactly remember.
Your patch seems perfect for that situation. :-)
Keen on seeing it in a future release. Thanks in advance. Did someone
suggest it or was it your very own idea?

    -- Dirk
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help