git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Eric Andrew Lewis <eric.andrew.lewis@gmail.com>
Cc: git@vger.kernel.org, Tay Ray Chuan <rctay89@gmail.com>,
	David Michael Barr <b@rr-dav.id.au>,
	Thomas Rast <tr@thomasrast.ch>
Subject: Re: [Feature Request] Did you mean `git ...`? should ask user for feedback, not return to the prompt
Date: Thu, 19 Dec 2013 15:17:59 -0800	[thread overview]
Message-ID: <20131219231759.GF20443@google.com> (raw)
In-Reply-To: <CAMi+fEnVekrWYrG6sGiRPmOXxaJ1-Y9xd83W7Wvw3GwWz8DuBQ@mail.gmail.com>

(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

      reply	other threads:[~2013-12-19 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131219231759.GF20443@google.com \
    --to=jrnieder@gmail.com \
    --cc=b@rr-dav.id.au \
    --cc=eric.andrew.lewis@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rctay89@gmail.com \
    --cc=tr@thomasrast.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).