threads / discuss / 44728

Suggestion for the "Did you mean this?" feature

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

## tl;dr

14 messages between Dec 18, 2016 and Jun 21, 2017.

replies: 13people: 6as markdown or json

Kaartic Sivaraam· Dec 18, 2016, 12:18 UTC · lore
Hello all,

I have found the "Did you mean this?" feature of git as a very good feature. I thought it would be even better if it took a step toward by asking for a prompt when there was only one alternative to the command that was entered. 

E.g.
Show 10 quoted lines
> unique@unique-pc:~$ git hepl
> git: 'hepl' is not a git command. See 'git --help'.
> 
> Did you mean this?
> 	help
> [yes/No] : y
> usage: git [--version] [--help] [-C <path>] [-c name=value]
>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-
> path]
> ....

This would make it even better for the user as it would avoid having to correct the mistake long commands that had only a single error (considering history feature is enabled).

Is this is a good idea ?
-- 
Regards,
Kaartic
Stephan Beyer· Dec 18, 2016, 13:16 UTC · re: Kaartic Sivaraam · lore

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

Hi,
On 12/18/2016 01:18 PM, Kaartic Sivaraam wrote:
Show 23 quoted lines
> I have found the "Did you mean this?" feature of git as a very good
> feature. I thought it would be even better if it took a step toward by
> asking for a prompt when there was only one alternative to the command
> that was entered. 
> 
> E.g.
> 
>> unique@unique-pc:~$ git hepl
>> git: 'hepl' is not a git command. See 'git --help'.
>>
>> Did you mean this?
>> 	help
>> [yes/No] : y
>> usage: git [--version] [--help] [-C <path>] [-c name=value]
>>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-
>> path]
>> ....
> 
> This would make it even better for the user as it would avoid having to
> correct the mistake long commands that had only a single error
> (considering history feature is enabled). 
> 
> Is this is a good idea ?

I cannot tell if this is a good idea (or why it would be a bad idea) but why do you restrict your suggestion to the case when there is only one alternative?

Why not also something like:

--- $ git sta git: 'sta' is not a git command. See 'git --help'.

Did you mean one of these?
	[1] status
	[2] stage
	[3] stash
You can choose or quit [1,2,3,q]:
---
Best
  Stephan
Kaartic Sivaraam· Dec 18, 2016, 13:26 UTC · re: Stephan Beyer · lore

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

On Sun, 2016-12-18 at 14:16 +0100, Stephan Beyer wrote:
Show 17 quoted lines
> I cannot tell if this is a good idea (or why it would be a bad idea)
> but
> why do you restrict your suggestion to the case when there is only
> one
> alternative?
> 
> Why not also something like:
> 
> ---
> $ git sta
> git: 'sta' is not a git command. See 'git --help'.
> 
> Did you mean one of these?
> 	[1] status
> 	[2] stage
> 	[3] stash
> You can choose or quit [1,2,3,q]:

That would be fine too. Just thought it would be a good start to start with a simple case. Also, I wasn't sure if there were any drawback's that I was missing. I guess if it was implemented it wouldn't be difficult to extend it further.

-- 
Regards,
Kaartic
Alexei Lozovsky· Dec 18, 2016, 15:16 UTC · re: Kaartic Sivaraam · lore

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

On 18 December 2016 at 14:18, Kaartic Sivaraam wrote:
Show 25 quoted lines
> Hello all,
>
> I have found the "Did you mean this?" feature of git as a very good
> feature. I thought it would be even better if it took a step toward by
> asking for a prompt when there was only one alternative to the command
> that was entered.
>
> E.g.
>
>> unique@unique-pc:~$ git hepl
>> git: 'hepl' is not a git command. See 'git --help'.
>>
>> Did you mean this?
>>       help
>> [yes/No] : y
>> usage: git [--version] [--help] [-C <path>] [-c name=value]
>>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-
>> path]
>> ....
>
> This would make it even better for the user as it would avoid having to
> correct the mistake long commands that had only a single error
> (considering history feature is enabled).
>
> Is this is a good idea ?

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.

Chris Packham· Dec 19, 2016, 00:48 UTC · re: Kaartic Sivaraam · lore

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

On Mon, Dec 19, 2016 at 1:18 AM, Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> wrote:

Show 25 quoted lines
> Hello all,
>
> I have found the "Did you mean this?" feature of git as a very good
> feature. I thought it would be even better if it took a step toward by
> asking for a prompt when there was only one alternative to the command
> that was entered.
>
> E.g.
>
>> unique@unique-pc:~$ git hepl
>> git: 'hepl' is not a git command. See 'git --help'.
>>
>> Did you mean this?
>>       help
>> [yes/No] : y
>> usage: git [--version] [--help] [-C <path>] [-c name=value]
>>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-
>> path]
>> ....
>
> This would make it even better for the user as it would avoid having to
> correct the mistake long commands that had only a single error
> (considering history feature is enabled).
>
> Is this is a good idea ?

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.

Marc Branchaud· Dec 19, 2016, 17:01 UTC · re: Chris Packham · lore

[PATCH] Tweak help auto-correct phrasing.

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---
On 2016-12-18 07:48 PM, 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.
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'.
		M.
 help.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/help.c b/help.c
index 53e2a67e00..55350c0673 100644
--- a/help.c
+++ b/help.c
@@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)
 		clean_cmdnames(&main_cmds);
 		fprintf_ln(stderr,
 			   _("WARNING: You called a Git command named '%s', "
-			     "which does not exist.\n"
-			     "Continuing under the assumption that you meant '%s'"),
-			cmd, assumed);
-		if (autocorrect > 0) {
-			fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
-				(float)autocorrect/10.0);
+			     "which does not exist."),
+			   cmd);
+		if (autocorrect < 0)
+			fprintf_ln(stderr,
+				   _("Continuing under the assumption that "
+				     "you meant '%s'."),
+				   assumed);
+		else {
+			fprintf_ln(stderr,
+				   _("Continuing in %0.1f seconds under the "
+				     "assumption that you meant '%s'."),
+				   (float)autocorrect/10.0, assumed);
 			sleep_millisec(autocorrect * 100);
 		}
 		return assumed;
-- 
2.11.0.dirty
Junio C Hamano· Dec 19, 2016, 22:04 UTC · re: Marc Branchaud · lore

Re: [PATCH] Tweak help auto-correct phrasing.

Marc Branchaud <marcnarc@xiplink.com> writes:
Show 25 quoted lines
> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
> ---
>
> On 2016-12-18 07:48 PM, 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.
>
> 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'.
>
> 		M.
Sounds better.

The "Instead of ... we now show ..." description deserves to be in the log message, not after "---" line.

s/under the assumption/assuming/ would make it even shorter and give the potentially long corrected command name a chance to still fit on the line without wrapping, I would think, though.

Show 33 quoted lines
>
>  help.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/help.c b/help.c
> index 53e2a67e00..55350c0673 100644
> --- a/help.c
> +++ b/help.c
> @@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)
>  		clean_cmdnames(&main_cmds);
>  		fprintf_ln(stderr,
>  			   _("WARNING: You called a Git command named '%s', "
> -			     "which does not exist.\n"
> -			     "Continuing under the assumption that you meant '%s'"),
> -			cmd, assumed);
> -		if (autocorrect > 0) {
> -			fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
> -				(float)autocorrect/10.0);
> +			     "which does not exist."),
> +			   cmd);
> +		if (autocorrect < 0)
> +			fprintf_ln(stderr,
> +				   _("Continuing under the assumption that "
> +				     "you meant '%s'."),
> +				   assumed);
> +		else {
> +			fprintf_ln(stderr,
> +				   _("Continuing in %0.1f seconds under the "
> +				     "assumption that you meant '%s'."),
> +				   (float)autocorrect/10.0, assumed);
>  			sleep_millisec(autocorrect * 100);
>  		}
>  		return assumed;
Marc Branchaud· Dec 20, 2016, 14:02 UTC · re: Junio C Hamano · lore

[PATCHv2] Tweak help auto-correct phrasing.

When auto-correct is enabled, an invalid git command prints a warning and a continuation message, which differs depending on whether or not help.autoCorrect is positive or negative.

With help.autoCorrect = 15:
   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...
With help.autoCorrect < 0:
   WARNING: You called a Git command named 'lgo', which does not exist.
   Continuing under the assumption that you meant 'log'

The continuation message's phrasing is awkward. This commit cleans it up. As a bonus, we now use full-sentence strings which make translation easier.

With help.autoCorrect = 15:
   WARNING: You called a Git command named 'lgo', which does not exist.
   Continuing in 1.5 seconds, assuming that you meant 'log'.
With help.autoCorrect < 0:
   WARNING: You called a Git command named 'lgo', which does not exist.
   Continuing under the assumption that you meant 'log'.
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---
Writing the commit message was more work than the commit!  :)
		M.
 help.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/help.c b/help.c
index 53e2a67e00..fc56aa2d76 100644
--- a/help.c
+++ b/help.c
@@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)
 		clean_cmdnames(&main_cmds);
 		fprintf_ln(stderr,
 			   _("WARNING: You called a Git command named '%s', "
-			     "which does not exist.\n"
-			     "Continuing under the assumption that you meant '%s'"),
-			cmd, assumed);
-		if (autocorrect > 0) {
-			fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
-				(float)autocorrect/10.0);
+			     "which does not exist."),
+			   cmd);
+		if (autocorrect < 0)
+			fprintf_ln(stderr,
+				   _("Continuing under the assumption that "
+				     "you meant '%s'."),
+				   assumed);
+		else {
+			fprintf_ln(stderr,
+				   _("Continuing in %0.1f seconds, "
+				     "assuming that you meant '%s'."),
+				   (float)autocorrect/10.0, assumed);
 			sleep_millisec(autocorrect * 100);
 		}
 		return assumed;
-- 
2.11.0.1.g75fa99b
Kaartic Sivaraam· Jun 20, 2017, 18:04 UTC · re: Marc Branchaud · lore

Re: [PATCHv2] Tweak help auto-correct phrasing.

On Tue, 2016-12-20 at 09:02 -0500, Marc Branchaud wrote:
Show 38 quoted lines
> When auto-correct is enabled, an invalid git command prints a warning
> and
> a continuation message, which differs depending on whether or not
> help.autoCorrect is positive or negative.
> 
> With help.autoCorrect = 15:
> 
>    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...
> 
> With help.autoCorrect < 0:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing under the assumption that you meant 'log'
> 
> The continuation message's phrasing is awkward.  This commit cleans
> it up.
> As a bonus, we now use full-sentence strings which make translation
> easier.
> 
> With help.autoCorrect = 15:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing in 1.5 seconds, assuming that you meant 'log'.
> 
> With help.autoCorrect < 0:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing under the assumption that you meant 'log'.
> 
> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
> ---
> 

Excuse me for bringing this up after a long time. What's the status of this patch? Was it applied?

-- 
Regards,
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Marc Branchaud· Jun 20, 2017, 18:21 UTC · re: Kaartic Sivaraam · lore

Re: [PATCHv2] Tweak help auto-correct phrasing.

On 2017-06-20 02:04 PM, Kaartic Sivaraam wrote:
Show 41 quoted lines
> On Tue, 2016-12-20 at 09:02 -0500, Marc Branchaud wrote:
>> When auto-correct is enabled, an invalid git command prints a warning
>> and
>> a continuation message, which differs depending on whether or not
>> help.autoCorrect is positive or negative.
>>
>> With help.autoCorrect = 15:
>>
>>     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...
>>
>> With help.autoCorrect < 0:
>>
>>     WARNING: You called a Git command named 'lgo', which does not
>> exist.
>>     Continuing under the assumption that you meant 'log'
>>
>> The continuation message's phrasing is awkward.  This commit cleans
>> it up.
>> As a bonus, we now use full-sentence strings which make translation
>> easier.
>>
>> With help.autoCorrect = 15:
>>
>>     WARNING: You called a Git command named 'lgo', which does not
>> exist.
>>     Continuing in 1.5 seconds, assuming that you meant 'log'.
>>
>> With help.autoCorrect < 0:
>>
>>     WARNING: You called a Git command named 'lgo', which does not
>> exist.
>>     Continuing under the assumption that you meant 'log'.
>>
>> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
>> ---
>>
> Excuse me for bringing this up after a long time. What's the status of
> this patch? Was it applied?
Looks like it got lost in the shuffle.
The topic thread starts at:
	http://public-inbox.org/git/1482063500.10858.1.camel@gmail.com/

There's no reply to my v2 patch, and I neglected to follow up on it -- sorry!

Shall I resend the patch?
		M.
Marc Branchaud· Jun 21, 2017, 13:57 UTC · re: Marc Branchaud · lore

[PATCHv2 (resend)] Tweak help auto-correct phrasing.

When auto-correct is enabled, an invalid git command prints a warning and a continuation message, which differs depending on whether or not help.autoCorrect is positive or negative.

With help.autoCorrect = 15:
   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...
With help.autoCorrect < 0:
   WARNING: You called a Git command named 'lgo', which does not exist.
   Continuing under the assumption that you meant 'log'

The continuation message's phrasing is awkward. This commit cleans it up. As a bonus, we now use full-sentence strings which make translation easier.

With help.autoCorrect = 15:
   WARNING: You called a Git command named 'lgo', which does not exist.
   Continuing in 1.5 seconds, assuming that you meant 'log'.
With help.autoCorrect < 0:
   WARNING: You called a Git command named 'lgo', which does not exist.
   Continuing under the assumption that you meant 'log'.
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---
So here's the patch again.
		M.
 help.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/help.c b/help.c
index f637fc800..69966c174 100644
--- a/help.c
+++ b/help.c
@@ -356,12 +356,18 @@ const char *help_unknown_cmd(const char *cmd)
 		clean_cmdnames(&main_cmds);
 		fprintf_ln(stderr,
 			   _("WARNING: You called a Git command named '%s', "
-			     "which does not exist.\n"
-			     "Continuing under the assumption that you meant '%s'"),
-			cmd, assumed);
-		if (autocorrect > 0) {
-			fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
-				(float)autocorrect/10.0);
+			     "which does not exist."),
+			   cmd);
+		if (autocorrect < 0)
+			fprintf_ln(stderr,
+				   _("Continuing under the assumption that "
+				     "you meant '%s'."),
+				   assumed);
+		else {
+			fprintf_ln(stderr,
+				   _("Continuing in %0.1f seconds, "
+				     "assuming that you meant '%s'."),
+				   (float)autocorrect/10.0, assumed);
 			sleep_millisec(autocorrect * 100);
 		}
 		return assumed;
-- 
2.13.1.388.g69e6b9b4f.dirty
Junio C Hamano· Jun 21, 2017, 22:34 UTC · re: Marc Branchaud · lore

Re: [PATCHv2 (resend)] Tweak help auto-correct phrasing.

Marc Branchaud <marcnarc@xiplink.com> writes:
Show 32 quoted lines
> When auto-correct is enabled, an invalid git command prints a warning and
> a continuation message, which differs depending on whether or not
> help.autoCorrect is positive or negative.
>
> With help.autoCorrect = 15:
>
>    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...
>
> With help.autoCorrect < 0:
>
>    WARNING: You called a Git command named 'lgo', which does not exist.
>    Continuing under the assumption that you meant 'log'
>
> The continuation message's phrasing is awkward.  This commit cleans it up.
> As a bonus, we now use full-sentence strings which make translation easier.
>
> With help.autoCorrect = 15:
>
>    WARNING: You called a Git command named 'lgo', which does not exist.
>    Continuing in 1.5 seconds, assuming that you meant 'log'.
>
> With help.autoCorrect < 0:
>
>    WARNING: You called a Git command named 'lgo', which does not exist.
>    Continuing under the assumption that you meant 'log'.
>
> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
> ---
>
> So here's the patch again.

Thanks. Will queue and wait for people to yell at us when this breaks their setup (which I highly doubt would happen ;-).

Show 32 quoted lines
>  help.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/help.c b/help.c
> index f637fc800..69966c174 100644
> --- a/help.c
> +++ b/help.c
> @@ -356,12 +356,18 @@ const char *help_unknown_cmd(const char *cmd)
>  		clean_cmdnames(&main_cmds);
>  		fprintf_ln(stderr,
>  			   _("WARNING: You called a Git command named '%s', "
> -			     "which does not exist.\n"
> -			     "Continuing under the assumption that you meant '%s'"),
> -			cmd, assumed);
> -		if (autocorrect > 0) {
> -			fprintf_ln(stderr, _("in %0.1f seconds automatically..."),
> -				(float)autocorrect/10.0);
> +			     "which does not exist."),
> +			   cmd);
> +		if (autocorrect < 0)
> +			fprintf_ln(stderr,
> +				   _("Continuing under the assumption that "
> +				     "you meant '%s'."),
> +				   assumed);
> +		else {
> +			fprintf_ln(stderr,
> +				   _("Continuing in %0.1f seconds, "
> +				     "assuming that you meant '%s'."),
> +				   (float)autocorrect/10.0, assumed);
>  			sleep_millisec(autocorrect * 100);
>  		}
>  		return assumed;
Kaartic Sivaraam· Jun 20, 2017, 18:00 UTC · re: Marc Branchaud · lore

Re: [PATCHv2] Tweak help auto-correct phrasing.

On Tue, 2016-12-20 at 09:02 -0500, Marc Branchaud wrote:
Show 80 quoted lines
> When auto-correct is enabled, an invalid git command prints a warning
> and
> a continuation message, which differs depending on whether or not
> help.autoCorrect is positive or negative.
> 
> With help.autoCorrect = 15:
> 
>    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...
> 
> With help.autoCorrect < 0:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing under the assumption that you meant 'log'
> 
> The continuation message's phrasing is awkward.  This commit cleans
> it up.
> As a bonus, we now use full-sentence strings which make translation
> easier.
> 
> With help.autoCorrect = 15:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing in 1.5 seconds, assuming that you meant 'log'.
> 
> With help.autoCorrect < 0:
> 
>    WARNING: You called a Git command named 'lgo', which does not
> exist.
>    Continuing under the assumption that you meant 'log'.
> 
> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
> ---
> 
> Writing the commit message was more work than the commit!  :)
> 
> 		M.
> 
>  help.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/help.c b/help.c
> index 53e2a67e00..fc56aa2d76 100644
> --- a/help.c
> +++ b/help.c
> @@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)
>  		clean_cmdnames(&main_cmds);
>  		fprintf_ln(stderr,
>  			   _("WARNING: You called a Git command
> named '%s', "
> -			     "which does not exist.\n"
> -			     "Continuing under the assumption that
> you meant '%s'"),
> -			cmd, assumed);
> -		if (autocorrect > 0) {
> -			fprintf_ln(stderr, _("in %0.1f seconds
> automatically..."),
> -				(float)autocorrect/10.0);
> +			     "which does not exist."),
> +			   cmd);
> +		if (autocorrect < 0)
> +			fprintf_ln(stderr,
> +				   _("Continuing under the
> assumption that "
> +				     "you meant '%s'."),
> +				   assumed);
> +		else {
> +			fprintf_ln(stderr,
> +				   _("Continuing in %0.1f seconds, "
> +				     "assuming that you meant
> '%s'."),
> +				   (float)autocorrect/10.0,
> assumed);
>  			sleep_millisec(autocorrect * 100);
>  		}
>  		return assumed;

Excuse me bringing this up after a long time. Was this patch applied? What's it's status?

-- 
Regards,
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Kaartic Sivaraam· Dec 19, 2016, 19:24 UTC · re: Chris Packham · lore

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

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

← back to recent threads