git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Feature Request] Did you mean `git ...`? should ask user for feedback, not return to the prompt
@ 2013-12-19 22:38 Eric Andrew Lewis
  2013-12-19 23:17 ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Andrew Lewis @ 2013-12-19 22:38 UTC (permalink / raw)
  To: git

Git is smart enough to realize when you make a spelling error and
enter a non-existent git command. Since you probably do mean what it
suggests, it follows that the user would want to immediately say “yes,
I did want to do that,” rather than return to the command line to
enter the command again.

e.g.

$ git psh
git: 'psh' is not a git command. See 'git —help'.
Did you mean 'push'[y/n]?

--
Eric Andrew Lewis

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Feature Request] Did you mean `git ...`? should ask user for feedback, not return to the prompt
  2013-12-19 22:38 [Feature Request] Did you mean `git ...`? should ask user for feedback, not return to the prompt Eric Andrew Lewis
@ 2013-12-19 23:17 ` Jonathan Nieder
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Nieder @ 2013-12-19 23:17 UTC (permalink / raw)
  To: Eric Andrew Lewis; +Cc: git, Tay Ray Chuan, David Michael Barr, Thomas Rast

(cc-ing area experts)
Hi,

Eric Andrew Lewis wrote:

> Git is smart enough to realize when you make a spelling error and
> enter a non-existent git command. Since you probably do mean what it
> suggests, it follows that the user would want to immediately say “yes,
> I did want to do that,” rather than return to the command line to
> enter the command again.

Yeah, it's a real tease. :/

> e.g.
>
> $ git psh
> git: 'psh' is not a git command. See 'git —help'.
> Did you mean 'push'[y/n]?

This is a natural extension to the existing "ticking time bomb"
feature that can be enabled with

	echo '[help] autocorrect = 50' >>~/.gitconfig

Some value like "autocorrect = ask" could mean to prompt, and the
default behavior could be not to prompt (to avoid breaking muscle
memory for people used to the usual "just succeed or fail, don't
interact" behavior) but to mention that configuration in the output to
make it easy to discover.

With that tiny tweak, it sounds good to me.  I stole this idea from
http://thread.gmane.org/gmane.comp.version-control.git/197151/focus=197249
and the surrounding thread, which also has rough hints toward an
implementation.

Thanks and hope that helps,
Jonathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-19 23:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 22:38 [Feature Request] Did you mean `git ...`? should ask user for feedback, not return to the prompt Eric Andrew Lewis
2013-12-19 23:17 ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).