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

Re: [PATCH 4/4] allow recovery from command name typos

From
Tay Ray Chuan <rctay89@gmail.com>
Date
May 6, 2012, 16:04 UTC
Message-ID
<CALUzUxqzi7aJ30q16+dwSnu_ULoC2zM-EDp1+BHTu2cPU9ihnQ@mail.gmail.com>
In-Reply-To
<CAOBOgRaDEgAqXWmdC6hrudkL5OwzeMffbj2RtKMxf2TsYWzotA@mail.gmail.com>
On Sun, May 6, 2012 at 4:40 PM, Angus Hammond <angusgh@gmail.com> wrote:
Show 12 quoted lines
> On 6 May 2012 07:55, Tay Ray Chuan <rctay89@gmail.com> wrote:
>>
>> In the case where there is a single suggestion, present the prompt
>> "[Y/n]", such that "", "y" and "Y" as input leads git to proceed
>> executing the suggestion, while everything else (possibly "n") leads git
>> to terminate.
>>
>
> Minor point, as well as ensuring this is configurable behavior, if
> terminating is the default, then the prompt should be "[y/N]", so that the
> default action is clearly marked. Not capitalising at all would be
> reasonable, but making the 'Y' uppercase is actively confusing.

I believe you were referring to the 1/2/.../n case, since for the y/n case, terminating is not the default.

If so, then yes, the "n" there should be in caps, since terminating is the default; my bad.

Show 5 quoted lines
> Secondly, if we're at a tty, I suspect this behavior would be totally
> unnecessary. Making close suggestions rather than just a complete list is
> neat, but if people want to use one of them all they have to do is copy
> paste the old command down and modify it, which I suspect would be much
> faster than actually considering and responding to a prompt.

I believe that there would be very few options to choose from - in fact, I was trying very hard to get the number of suggestions to equal or exceed 5. I guess one would have better luck than I if they studied the Levenshtein distance algorithm, which I didn't.

In other words - the time to consider is small.

In fact I was hoping this would be faster than copy-paste - typing the option (1 key) and enter (1 key) makes a total of 2 keys only.

-- 
Cheers,
Ray Chuan
Previous: Junio C Hamano
Message 37 of 37 in “allow recovery from command name typos”
  1. 0/4 allow recovery from command name typosTay Ray Chuan, May 6, 2012
  2. 1/4 help.c::uniq: plug a leakTay Ray Chuan, May 6, 2012
  3. 2/4 help.c::exclude_cmds: plug a leakTay Ray Chuan, May 6, 2012
  4. 3/4 help.c: plug a leak when help.autocorrect is setTay Ray Chuan, May 6, 2012
  5. 4/4 allow recovery from command name typosTay Ray Chuan, May 6, 2012
  6. Jeff KingMay 6, 2012
  7. Tay Ray ChuanMay 6, 2012
  8. Thomas RastMay 7, 2012
  9. Tay Ray ChuanMay 7, 2012
  10. Junio C HamanoMay 7, 2012
  11. Tay Ray ChuanMay 9, 2012
  12. Junio C HamanoMay 9, 2012
  13. Jeff KingMay 6, 2012
  14. Tay Ray ChuanMay 6, 2012
  15. Jeff KingMay 7, 2012
  16. 0/4 allow recovery from command name typosTay Ray Chuan, Jul 25, 2012
  17. 1/4 help.c::uniq: plug a leakTay Ray Chuan, Jul 25, 2012
  18. 2/4 help.c::exclude_cmds: realloc() before copy, plug a leakTay Ray Chuan, Jul 25, 2012
  19. 3/4 help.c: plug leaks with(out) help.autocorrectTay Ray Chuan, Jul 25, 2012
  20. 4/4 allow recovery from command name typosTay Ray Chuan, Jul 25, 2012
  21. Junio C HamanoJul 25, 2012
  22. Tay Ray ChuanJul 26, 2012
  23. Jeff KingJul 26, 2012
  24. Junio C HamanoJul 26, 2012
  25. Jeff KingJul 26, 2012
  26. Junio C HamanoJul 26, 2012
  27. Junio C HamanoJul 25, 2012
  28. Junio C HamanoJul 25, 2012
  29. 0/2 allow recovery from command name typosTay Ray Chuan, Aug 5, 2012
  30. 1/2 add interface for /dev/tty interactionTay Ray Chuan, Aug 5, 2012
  31. 2/2 allow recovery from command name typosTay Ray Chuan, Aug 5, 2012
  32. Junio C HamanoAug 6, 2012
  33. Junio C HamanoAug 5, 2012
  34. Jeff KingAug 6, 2012
  35. Jeff KingAug 6, 2012
  36. Junio C HamanoAug 6, 2012
  37. Tay Ray ChuanMay 6, 2012

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.