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: Robin Rosenberg <hidden>
Date: 2016-06-15 22:44:42

torsdagen den 5 juni 2008 08.48.40 skrev Johannes Schindelin:
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
Sorry about my negativity here..

Doesn't this confuse more than it helps? Most people do not need to know about rerere, rev-parse or merge-base so it is very unlikely they actually meant those. That might be an issue of tuning than general principles, but I have my doubts. It won't hint that there are wildly different variants of rebase, which ctually might be much more important to know than rerere, not will it tell svn users that git revert isn't even close to svn revert.

Completion or git gui is a much better tool for solving this isssue

Some ancient LISP had a DWIM (do what I mean) and there might be a reason it has not become ery popular.

Despite not being useful, it's still cool :)

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