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

Re: Suggestion for the "Did you mean this?" feature

From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Date
Dec 19, 2016, 19:24 UTC
Message-ID
<1482175466.2882.2.camel@gmail.com>
In-Reply-To
<CAFOYHZDnpzdYq9j4-xGSdKZQX9deLBpZZhz209qV7cCtq537SA@mail.gmail.com>
Hello all,
On Sun, 18 December 2016 at 20:59, Alexei Lozovsky wrote,
Show 23 quoted lines
> It's definitely a good thing for human users. For example, I am
> annoyed
> from time to time when I type in some long spell, mistype one minor
> thing,
> and the whole command fails. Then I need to press <up>, correct the
> obvious typo, and run the command again.
> 
> Though, there is one aspect which may be the reason why git does not
> have
> this feature: it requires interactive input. For example, it won't
> work
> if some script tries to run an invalid git command. And git cannot
> really
> tell whether it is running interactively or in a batch mode. If it is
> running in batch mode then the whole script may hang indefinitely
> waiting
> for nonexistent input. This also may apply to using git with pipes.
> 
> Maybe a configuration option or some GIT_NO_PROMPT environment
> variable
> may be used to force disable this, but it still will be a hassle for
> the
> scripts.

This is a good point that I didn't think of, sir. Thanks for bringing it up. It seems that in some other form git does have the feature I was suggesting.

On Mon, 2016-12-19 at 13:48 +1300, Chris Packham wrote:
> This feature already exists (although it's not interactive). See
> help.autoCorrect in the git-config man page. "git config
> help.autoCorrect -1" should to the trick.

Thanks for bringing this to notice, sir. I wasn't aware of it before. It's in essence the same feature.

On Mon, 2016-12-19 at 12:01 -0500, Marc Branchaud wrote:
Show 21 quoted lines
> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
> ---
> 
> Awesome, I was unaware of this feature.  Thanks!
> 
> I found the message it prints a bit awkward, so here's a patch to fix
> it up.
> 
> Instead of:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing under the assumption that you meant 'log'
>    in 1.5 seconds automatically...
> 
> it's now:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing in 1.5 seconds under the assumption that you meant
> 'log'.

Happy that my mail introduced a little change to git by revealing a not often used feature.

-- 
Regards,
Kaartic
Previous: Kaartic Sivaraam
Message 14 of 14 in “Suggestion for the "Did you mean this?" feature”
  1. Kaartic SivaraamDec 18, 2016
  2. Stephan BeyerDec 18, 2016
  3. Kaartic SivaraamDec 18, 2016
  4. Alexei LozovskyDec 18, 2016
  5. Chris PackhamDec 19, 2016
  6. Tweak help auto-correct phrasing.Marc Branchaud, Dec 19, 2016
  7. Junio C HamanoDec 19, 2016
  8. [PATCHv2] Tweak help auto-correct phrasing.Marc Branchaud, Dec 20, 2016
  9. Kaartic SivaraamJun 20, 2017
  10. Marc BranchaudJun 20, 2017
  11. [PATCHv2 (resend)] Tweak help auto-correct phrasing.Marc Branchaud, Jun 21, 2017
  12. Junio C HamanoJun 21, 2017
  13. Kaartic SivaraamJun 20, 2017
  14. Kaartic SivaraamDec 19, 2016

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.