git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
DSDirk Süsserott <newsletter@dirk.my1.cc>
Date
Jun 5, 2008, 20:59 UTC
Message-ID
<484853B1.80509@dirk.my1.cc>
In-Reply-To
<alpine.DEB.1.00.0806050747000.21190@racer>
Johannes Schindelin schrieb:
Show 23 quoted lines
> 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 <johannes.schindelin@gmx.de>
> ---
> 	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
Previous: Sverre RabbelierNext: Johannes Schindelin
Message 17 of 28 in “git wrapper: show similar command names for an unknown command”
  1. git wrapper: show similar command names for an unknown commandJohannes Schindelin, Jun 5, 2008
  2. Add subcommand "help" to the list of most commonly used subcommandsTeemu Likonen, Jun 5, 2008
  3. Johannes SchindelinJun 5, 2008
  4. Teemu LikonenJun 5, 2008
  5. 1/2 Add subcommand "help" to the list of most commonly used subcommandsTeemu Likonen, Jun 5, 2008
  6. 2/2 More informative short description for git-help.txtTeemu Likonen, Jun 5, 2008
  7. Johannes SchindelinJun 5, 2008
  8. Sverre RabbelierJun 5, 2008
  9. Teemu LikonenJun 5, 2008
  10. Junio C HamanoJun 5, 2008
  11. Pieter de BieJun 5, 2008
  12. Teemu LikonenJun 5, 2008
  13. Junio C HamanoJun 5, 2008
  14. David SymondsJun 6, 2008
  15. Wincent ColaiutaJun 5, 2008
  16. Sverre RabbelierJun 5, 2008
  17. Dirk SüsserottJun 5, 2008
  18. Johannes SchindelinJun 5, 2008
  19. Robin RosenbergJun 6, 2008
  20. Wincent ColaiutaJun 6, 2008
  21. Alex RiesenJun 7, 2008
  22. Johannes SchindelinJun 7, 2008
  23. Alex RiesenJun 7, 2008
  24. Junio C HamanoJun 7, 2008
  25. Johannes SchindelinJun 8, 2008
  26. Dirk SüsserottJun 8, 2008
  27. Junio C HamanoJun 8, 2008
  28. Johannes SchindelinJun 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.