{"thread":{"id":"44728","subject":"Suggestion for the \"Did you mean this?\" feature","startedAt":"2016-12-18T12:18:37Z","lastAt":"2017-06-21T22:34:17Z","messageCount":14,"participants":["Kaartic Sivaraam","Stephan Beyer","Alexei Lozovsky","Chris Packham","Marc Branchaud","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"307988","messageId":"1482063500.10858.1.camel@gmail.com","threadId":"44728","inReplyTo":null,"subject":"Suggestion for the \"Did you mean this?\" feature","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2016-12-18T12:18:20Z","receivedAt":"2016-12-18T12:18:37Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Hello all,\n\nI have found the \"Did you mean this?\" feature of git as a very good\nfeature. I thought it would be even better if it took a step toward by\nasking for a prompt when there was only one alternative to the command\nthat was entered. \n\nE.g.\n\n> unique@unique-pc:~$ git hepl\n> git: 'hepl' is not a git command. See 'git --help'.\n> \n> Did you mean this?\n> \thelp\n> [yes/No] : y\n> usage: git [--version] [--help] [-C <path>] [-c name=value]\n>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-\n> path]\n> ....\n\nThis would make it even better for the user as it would avoid having to\ncorrect the mistake long commands that had only a single error\n(considering history feature is enabled). \n\nIs this is a good idea ?\n\n\n-- \n\n\nRegards,\nKaartic\n"},{"id":"307992","messageId":"5e1a3c4b-43b9-29f2-68fe-8149d9940123@gmx.net","threadId":"44728","inReplyTo":"1482063500.10858.1.camel@gmail.com","subject":"Re: Suggestion for the \"Did you mean this?\" feature","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2016-12-18T13:16:46Z","receivedAt":"2016-12-18T13:17:52Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nOn 12/18/2016 01:18 PM, Kaartic Sivaraam wrote:\n> I have found the \"Did you mean this?\" feature of git as a very good\n> feature. I thought it would be even better if it took a step toward by\n> asking for a prompt when there was only one alternative to the command\n> that was entered. \n> \n> E.g.\n> \n>> unique@unique-pc:~$ git hepl\n>> git: 'hepl' is not a git command. See 'git --help'.\n>>\n>> Did you mean this?\n>> \thelp\n>> [yes/No] : y\n>> usage: git [--version] [--help] [-C <path>] [-c name=value]\n>>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-\n>> path]\n>> ....\n> \n> This would make it even better for the user as it would avoid having to\n> correct the mistake long commands that had only a single error\n> (considering history feature is enabled). \n> \n> Is this is a good idea ?\n\nI cannot tell if this is a good idea (or why it would be a bad idea) but\nwhy do you restrict your suggestion to the case when there is only one\nalternative?\n\nWhy not also something like:\n\n---\n$ git sta\ngit: 'sta' is not a git command. See 'git --help'.\n\nDid you mean one of these?\n\t[1] status\n\t[2] stage\n\t[3] stash\nYou can choose or quit [1,2,3,q]:\n---\n\n\nBest\n  Stephan\n"},{"id":"307993","messageId":"1482067588.13943.4.camel@gmail.com","threadId":"44728","inReplyTo":"5e1a3c4b-43b9-29f2-68fe-8149d9940123@gmx.net","subject":"Re: Suggestion for the \"Did you mean this?\" feature","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2016-12-18T13:26:28Z","receivedAt":"2016-12-18T13:27:25Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Sun, 2016-12-18 at 14:16 +0100, Stephan Beyer wrote:\n\n> I cannot tell if this is a good idea (or why it would be a bad idea)\n> but\n> why do you restrict your suggestion to the case when there is only\n> one\n> alternative?\n> \n> Why not also something like:\n> \n> ---\n> $ git sta\n> git: 'sta' is not a git command. See 'git --help'.\n> \n> Did you mean one of these?\n> \t[1] status\n> \t[2] stage\n> \t[3] stash\n> You can choose or quit [1,2,3,q]:\n\nThat would be fine too. Just thought it would be a good start to start\nwith a simple case. Also, I wasn't sure if there were any drawback's\nthat I was missing. I guess if it was implemented it wouldn't be\ndifficult to extend it further.\n\n-- \n\n\nRegards,\nKaartic\n"},{"id":"307995","messageId":"CALhvvbZSn2KVeEw5L14WQTNwo7ZhN1DY-MG31ogA1ppUMUJvVA@mail.gmail.com","threadId":"44728","inReplyTo":"1482063500.10858.1.camel@gmail.com","subject":"Re: Suggestion for the \"Did you mean this?\" feature","fromName":"Alexei Lozovsky","fromEmail":"a.lozovsky@gmail.com","sentAt":"2016-12-18T15:16:09Z","receivedAt":"2016-12-18T15:17:24Z","isPatch":false,"sender":{"key":"a.lozovsky@gmail.com","avatar":"https://gravatar.com/avatar/8bb8ff5ec366dd64bd8e08f768082934513da367ae047bcb0039292e4ed6bda5?d=mp&s=160"},"body":"On 18 December 2016 at 14:18, Kaartic Sivaraam wrote:\n> Hello all,\n>\n> I have found the \"Did you mean this?\" feature of git as a very good\n> feature. I thought it would be even better if it took a step toward by\n> asking for a prompt when there was only one alternative to the command\n> that was entered.\n>\n> E.g.\n>\n>> unique@unique-pc:~$ git hepl\n>> git: 'hepl' is not a git command. See 'git --help'.\n>>\n>> Did you mean this?\n>>       help\n>> [yes/No] : y\n>> usage: git [--version] [--help] [-C <path>] [-c name=value]\n>>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-\n>> path]\n>> ....\n>\n> This would make it even better for the user as it would avoid having to\n> correct the mistake long commands that had only a single error\n> (considering history feature is enabled).\n>\n> Is this is a good idea ?\n\nIt's definitely a good thing for human users. For example, I am annoyed\nfrom time to time when I type in some long spell, mistype one minor thing,\nand the whole command fails. Then I need to press <up>, correct the\nobvious typo, and run the command again.\n\nThough, there is one aspect which may be the reason why git does not have\nthis feature: it requires interactive input. For example, it won't work\nif some script tries to run an invalid git command. And git cannot really\ntell whether it is running interactively or in a batch mode. If it is\nrunning in batch mode then the whole script may hang indefinitely waiting\nfor nonexistent input. This also may apply to using git with pipes.\n\nMaybe a configuration option or some GIT_NO_PROMPT environment variable\nmay be used to force disable this, but it still will be a hassle for the\nscripts.\n"},{"id":"308003","messageId":"CAFOYHZDnpzdYq9j4-xGSdKZQX9deLBpZZhz209qV7cCtq537SA@mail.gmail.com","threadId":"44728","inReplyTo":"1482063500.10858.1.camel@gmail.com","subject":"Re: Suggestion for the \"Did you mean this?\" feature","fromName":"Chris Packham","fromEmail":"judge.packham@gmail.com","sentAt":"2016-12-19T00:48:16Z","receivedAt":"2016-12-19T00:49:18Z","isPatch":false,"sender":{"key":"judge.packham@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155667?v=4"},"body":"On Mon, Dec 19, 2016 at 1:18 AM, Kaartic Sivaraam\n<kaarticsivaraam91196@gmail.com> wrote:\n> Hello all,\n>\n> I have found the \"Did you mean this?\" feature of git as a very good\n> feature. I thought it would be even better if it took a step toward by\n> asking for a prompt when there was only one alternative to the command\n> that was entered.\n>\n> E.g.\n>\n>> unique@unique-pc:~$ git hepl\n>> git: 'hepl' is not a git command. See 'git --help'.\n>>\n>> Did you mean this?\n>>       help\n>> [yes/No] : y\n>> usage: git [--version] [--help] [-C <path>] [-c name=value]\n>>            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-\n>> path]\n>> ....\n>\n> This would make it even better for the user as it would avoid having to\n> correct the mistake long commands that had only a single error\n> (considering history feature is enabled).\n>\n> Is this is a good idea ?\n\nThis feature already exists (although it's not interactive). See\nhelp.autoCorrect in the git-config man page. \"git config\nhelp.autoCorrect -1\" should to the trick.\n"},{"id":"308056","messageId":"20161219170137.5507-1-marcnarc@xiplink.com","threadId":"44728","inReplyTo":"CAFOYHZDnpzdYq9j4-xGSdKZQX9deLBpZZhz209qV7cCtq537SA@mail.gmail.com","subject":"[PATCH] Tweak help auto-correct phrasing.","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2016-12-19T17:01:37Z","receivedAt":"2016-12-19T17:02:33Z","isPatch":true,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n---\n\nOn 2016-12-18 07:48 PM, Chris Packham wrote:\n>\n> This feature already exists (although it's not interactive). See\n> help.autoCorrect in the git-config man page. \"git config\n> help.autoCorrect -1\" should to the trick.\n\nAwesome, I was unaware of this feature.  Thanks!\n\nI found the message it prints a bit awkward, so here's a patch to fix it up.\n\nInstead of:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing under the assumption that you meant 'log'\n   in 1.5 seconds automatically...\n\nit's now:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing in 1.5 seconds under the assumption that you meant 'log'.\n\n\t\tM.\n\n help.c | 18 ++++++++++++------\n 1 file changed, 12 insertions(+), 6 deletions(-)\n\ndiff --git a/help.c b/help.c\nindex 53e2a67e00..55350c0673 100644\n--- a/help.c\n+++ b/help.c\n@@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)\n \t\tclean_cmdnames(&main_cmds);\n \t\tfprintf_ln(stderr,\n \t\t\t   _(\"WARNING: You called a Git command named '%s', \"\n-\t\t\t     \"which does not exist.\\n\"\n-\t\t\t     \"Continuing under the assumption that you meant '%s'\"),\n-\t\t\tcmd, assumed);\n-\t\tif (autocorrect > 0) {\n-\t\t\tfprintf_ln(stderr, _(\"in %0.1f seconds automatically...\"),\n-\t\t\t\t(float)autocorrect/10.0);\n+\t\t\t     \"which does not exist.\"),\n+\t\t\t   cmd);\n+\t\tif (autocorrect < 0)\n+\t\t\tfprintf_ln(stderr,\n+\t\t\t\t   _(\"Continuing under the assumption that \"\n+\t\t\t\t     \"you meant '%s'.\"),\n+\t\t\t\t   assumed);\n+\t\telse {\n+\t\t\tfprintf_ln(stderr,\n+\t\t\t\t   _(\"Continuing in %0.1f seconds under the \"\n+\t\t\t\t     \"assumption that you meant '%s'.\"),\n+\t\t\t\t   (float)autocorrect/10.0, assumed);\n \t\t\tsleep_millisec(autocorrect * 100);\n \t\t}\n \t\treturn assumed;\n-- \n2.11.0.dirty\n\n"},{"id":"308085","messageId":"1482175466.2882.2.camel@gmail.com","threadId":"44728","inReplyTo":"CAFOYHZDnpzdYq9j4-xGSdKZQX9deLBpZZhz209qV7cCtq537SA@mail.gmail.com","subject":"Re: Suggestion for the \"Did you mean this?\" feature","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2016-12-19T19:24:26Z","receivedAt":"2016-12-19T19:23:42Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Hello all,\n\nOn Sun, 18 December 2016 at 20:59, Alexei Lozovsky wrote,\n> It's definitely a good thing for human users. For example, I am\n> annoyed\n> from time to time when I type in some long spell, mistype one minor\n> thing,\n> and the whole command fails. Then I need to press <up>, correct the\n> obvious typo, and run the command again.\n> \n> Though, there is one aspect which may be the reason why git does not\n> have\n> this feature: it requires interactive input. For example, it won't\n> work\n> if some script tries to run an invalid git command. And git cannot\n> really\n> tell whether it is running interactively or in a batch mode. If it is\n> running in batch mode then the whole script may hang indefinitely\n> waiting\n> for nonexistent input. This also may apply to using git with pipes.\n> \n> Maybe a configuration option or some GIT_NO_PROMPT environment\n> variable\n> may be used to force disable this, but it still will be a hassle for\n> the\n> scripts.\n\nThis is a good point that I didn't think of, sir. Thanks for bringing\nit up. It seems that in some other form git does have the feature I was\nsuggesting.\n\n\nOn Mon, 2016-12-19 at 13:48 +1300, Chris Packham wrote:\n> This feature already exists (although it's not interactive). See\n> help.autoCorrect in the git-config man page. \"git config\n> help.autoCorrect -1\" should to the trick.\nThanks for bringing this to notice, sir. I wasn't aware of it before.\nIt's in essence the same feature.\n\n\nOn Mon, 2016-12-19 at 12:01 -0500, Marc Branchaud wrote:\n> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n> ---\n> \n> Awesome, I was unaware of this feature.  Thanks!\n> \n> I found the message it prints a bit awkward, so here's a patch to fix\n> it up.\n> \n> Instead of:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing under the assumption that you meant 'log'\n>    in 1.5 seconds automatically...\n> \n> it's now:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing in 1.5 seconds under the assumption that you meant\n> 'log'.\nHappy that my mail introduced a little change to git by revealing a not\noften used feature.\n\n-- \n\n\nRegards,\nKaartic\n"},{"id":"308104","messageId":"xmqqpoknmv7d.fsf@gitster.mtv.corp.google.com","threadId":"44728","inReplyTo":"20161219170137.5507-1-marcnarc@xiplink.com","subject":"Re: [PATCH] Tweak help auto-correct phrasing.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-19T22:04:54Z","receivedAt":"2016-12-19T22:05:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marc Branchaud <marcnarc@xiplink.com> writes:\n\n> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n> ---\n>\n> On 2016-12-18 07:48 PM, Chris Packham wrote:\n>>\n>> This feature already exists (although it's not interactive). See\n>> help.autoCorrect in the git-config man page. \"git config\n>> help.autoCorrect -1\" should to the trick.\n>\n> Awesome, I was unaware of this feature.  Thanks!\n>\n> I found the message it prints a bit awkward, so here's a patch to fix it up.\n>\n> Instead of:\n>\n>    WARNING: You called a Git command named 'lgo', which does not exist.\n>    Continuing under the assumption that you meant 'log'\n>    in 1.5 seconds automatically...\n>\n> it's now:\n>\n>    WARNING: You called a Git command named 'lgo', which does not exist.\n>    Continuing in 1.5 seconds under the assumption that you meant 'log'.\n>\n> \t\tM.\n\nSounds better.\n\nThe \"Instead of ... we now show ...\" description deserves to be in\nthe log message, not after \"---\" line.\n\ns/under the assumption/assuming/ would make it even shorter and give\nthe potentially long corrected command name a chance to still fit on\nthe line without wrapping, I would think, though.\n\n>\n>  help.c | 18 ++++++++++++------\n>  1 file changed, 12 insertions(+), 6 deletions(-)\n>\n> diff --git a/help.c b/help.c\n> index 53e2a67e00..55350c0673 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)\n>  \t\tclean_cmdnames(&main_cmds);\n>  \t\tfprintf_ln(stderr,\n>  \t\t\t   _(\"WARNING: You called a Git command named '%s', \"\n> -\t\t\t     \"which does not exist.\\n\"\n> -\t\t\t     \"Continuing under the assumption that you meant '%s'\"),\n> -\t\t\tcmd, assumed);\n> -\t\tif (autocorrect > 0) {\n> -\t\t\tfprintf_ln(stderr, _(\"in %0.1f seconds automatically...\"),\n> -\t\t\t\t(float)autocorrect/10.0);\n> +\t\t\t     \"which does not exist.\"),\n> +\t\t\t   cmd);\n> +\t\tif (autocorrect < 0)\n> +\t\t\tfprintf_ln(stderr,\n> +\t\t\t\t   _(\"Continuing under the assumption that \"\n> +\t\t\t\t     \"you meant '%s'.\"),\n> +\t\t\t\t   assumed);\n> +\t\telse {\n> +\t\t\tfprintf_ln(stderr,\n> +\t\t\t\t   _(\"Continuing in %0.1f seconds under the \"\n> +\t\t\t\t     \"assumption that you meant '%s'.\"),\n> +\t\t\t\t   (float)autocorrect/10.0, assumed);\n>  \t\t\tsleep_millisec(autocorrect * 100);\n>  \t\t}\n>  \t\treturn assumed;\n"},{"id":"308141","messageId":"20161220140226.18456-1-marcnarc@xiplink.com","threadId":"44728","inReplyTo":"xmqqpoknmv7d.fsf@gitster.mtv.corp.google.com","subject":"[PATCHv2] Tweak help auto-correct phrasing.","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2016-12-20T14:02:26Z","receivedAt":"2016-12-20T14:10:54Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"When auto-correct is enabled, an invalid git command prints a warning and\na continuation message, which differs depending on whether or not\nhelp.autoCorrect is positive or negative.\n\nWith help.autoCorrect = 15:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing under the assumption that you meant 'log'\n   in 1.5 seconds automatically...\n\nWith help.autoCorrect < 0:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing under the assumption that you meant 'log'\n\nThe continuation message's phrasing is awkward.  This commit cleans it up.\nAs a bonus, we now use full-sentence strings which make translation easier.\n\nWith help.autoCorrect = 15:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing in 1.5 seconds, assuming that you meant 'log'.\n\nWith help.autoCorrect < 0:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing under the assumption that you meant 'log'.\n\nSigned-off-by: Marc Branchaud <marcnarc@xiplink.com>\n---\n\nWriting the commit message was more work than the commit!  :)\n\n\t\tM.\n\n help.c | 18 ++++++++++++------\n 1 file changed, 12 insertions(+), 6 deletions(-)\n\ndiff --git a/help.c b/help.c\nindex 53e2a67e00..fc56aa2d76 100644\n--- a/help.c\n+++ b/help.c\n@@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)\n \t\tclean_cmdnames(&main_cmds);\n \t\tfprintf_ln(stderr,\n \t\t\t   _(\"WARNING: You called a Git command named '%s', \"\n-\t\t\t     \"which does not exist.\\n\"\n-\t\t\t     \"Continuing under the assumption that you meant '%s'\"),\n-\t\t\tcmd, assumed);\n-\t\tif (autocorrect > 0) {\n-\t\t\tfprintf_ln(stderr, _(\"in %0.1f seconds automatically...\"),\n-\t\t\t\t(float)autocorrect/10.0);\n+\t\t\t     \"which does not exist.\"),\n+\t\t\t   cmd);\n+\t\tif (autocorrect < 0)\n+\t\t\tfprintf_ln(stderr,\n+\t\t\t\t   _(\"Continuing under the assumption that \"\n+\t\t\t\t     \"you meant '%s'.\"),\n+\t\t\t\t   assumed);\n+\t\telse {\n+\t\t\tfprintf_ln(stderr,\n+\t\t\t\t   _(\"Continuing in %0.1f seconds, \"\n+\t\t\t\t     \"assuming that you meant '%s'.\"),\n+\t\t\t\t   (float)autocorrect/10.0, assumed);\n \t\t\tsleep_millisec(autocorrect * 100);\n \t\t}\n \t\treturn assumed;\n-- \n2.11.0.1.g75fa99b\n\n"},{"id":"322746","messageId":"1497981886.28187.6.camel@gmail.com","threadId":"44728","inReplyTo":"20161220140226.18456-1-marcnarc@xiplink.com","subject":"Re: [PATCHv2] Tweak help auto-correct phrasing.","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-20T18:04:46Z","receivedAt":"2017-06-20T18:05:31Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Tue, 2016-12-20 at 09:02 -0500, Marc Branchaud wrote:\n> When auto-correct is enabled, an invalid git command prints a warning\n> and\n> a continuation message, which differs depending on whether or not\n> help.autoCorrect is positive or negative.\n> \n> With help.autoCorrect = 15:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing under the assumption that you meant 'log'\n>    in 1.5 seconds automatically...\n> \n> With help.autoCorrect < 0:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing under the assumption that you meant 'log'\n> \n> The continuation message's phrasing is awkward.  This commit cleans\n> it up.\n> As a bonus, we now use full-sentence strings which make translation\n> easier.\n> \n> With help.autoCorrect = 15:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing in 1.5 seconds, assuming that you meant 'log'.\n> \n> With help.autoCorrect < 0:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing under the assumption that you meant 'log'.\n> \n> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n> ---\n> \nExcuse me for bringing this up after a long time. What's the status of\nthis patch? Was it applied?\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n"},{"id":"322748","messageId":"3164ca01-9b54-3c9b-96d8-182c9fbbceb9@xiplink.com","threadId":"44728","inReplyTo":"1497981886.28187.6.camel@gmail.com","subject":"Re: [PATCHv2] Tweak help auto-correct phrasing.","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2017-06-20T18:21:42Z","receivedAt":"2017-06-20T18:21:49Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"On 2017-06-20 02:04 PM, Kaartic Sivaraam wrote:\n> On Tue, 2016-12-20 at 09:02 -0500, Marc Branchaud wrote:\n>> When auto-correct is enabled, an invalid git command prints a warning\n>> and\n>> a continuation message, which differs depending on whether or not\n>> help.autoCorrect is positive or negative.\n>>\n>> With help.autoCorrect = 15:\n>>\n>>     WARNING: You called a Git command named 'lgo', which does not\n>> exist.\n>>     Continuing under the assumption that you meant 'log'\n>>     in 1.5 seconds automatically...\n>>\n>> With help.autoCorrect < 0:\n>>\n>>     WARNING: You called a Git command named 'lgo', which does not\n>> exist.\n>>     Continuing under the assumption that you meant 'log'\n>>\n>> The continuation message's phrasing is awkward.  This commit cleans\n>> it up.\n>> As a bonus, we now use full-sentence strings which make translation\n>> easier.\n>>\n>> With help.autoCorrect = 15:\n>>\n>>     WARNING: You called a Git command named 'lgo', which does not\n>> exist.\n>>     Continuing in 1.5 seconds, assuming that you meant 'log'.\n>>\n>> With help.autoCorrect < 0:\n>>\n>>     WARNING: You called a Git command named 'lgo', which does not\n>> exist.\n>>     Continuing under the assumption that you meant 'log'.\n>>\n>> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n>> ---\n>>\n> Excuse me for bringing this up after a long time. What's the status of\n> this patch? Was it applied?\n\nLooks like it got lost in the shuffle.\n\nThe topic thread starts at:\n\thttp://public-inbox.org/git/1482063500.10858.1.camel@gmail.com/\n\nThere's no reply to my v2 patch, and I neglected to follow up on it -- \nsorry!\n\nShall I resend the patch?\n\n\t\tM.\n\n"},{"id":"322751","messageId":"1497981610.28187.3.camel@gmail.com","threadId":"44728","inReplyTo":"20161220140226.18456-1-marcnarc@xiplink.com","subject":"Re: [PATCHv2] Tweak help auto-correct phrasing.","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-06-20T18:00:10Z","receivedAt":"2017-06-20T18:34:05Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Tue, 2016-12-20 at 09:02 -0500, Marc Branchaud wrote:\n> When auto-correct is enabled, an invalid git command prints a warning\n> and\n> a continuation message, which differs depending on whether or not\n> help.autoCorrect is positive or negative.\n> \n> With help.autoCorrect = 15:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing under the assumption that you meant 'log'\n>    in 1.5 seconds automatically...\n> \n> With help.autoCorrect < 0:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing under the assumption that you meant 'log'\n> \n> The continuation message's phrasing is awkward.  This commit cleans\n> it up.\n> As a bonus, we now use full-sentence strings which make translation\n> easier.\n> \n> With help.autoCorrect = 15:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing in 1.5 seconds, assuming that you meant 'log'.\n> \n> With help.autoCorrect < 0:\n> \n>    WARNING: You called a Git command named 'lgo', which does not\n> exist.\n>    Continuing under the assumption that you meant 'log'.\n> \n> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n> ---\n> \n> Writing the commit message was more work than the commit!  :)\n> \n> \t\tM.\n> \n>  help.c | 18 ++++++++++++------\n>  1 file changed, 12 insertions(+), 6 deletions(-)\n> \n> diff --git a/help.c b/help.c\n> index 53e2a67e00..fc56aa2d76 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -381,12 +381,18 @@ const char *help_unknown_cmd(const char *cmd)\n>  \t\tclean_cmdnames(&main_cmds);\n>  \t\tfprintf_ln(stderr,\n>  \t\t\t   _(\"WARNING: You called a Git command\n> named '%s', \"\n> -\t\t\t     \"which does not exist.\\n\"\n> -\t\t\t     \"Continuing under the assumption that\n> you meant '%s'\"),\n> -\t\t\tcmd, assumed);\n> -\t\tif (autocorrect > 0) {\n> -\t\t\tfprintf_ln(stderr, _(\"in %0.1f seconds\n> automatically...\"),\n> -\t\t\t\t(float)autocorrect/10.0);\n> +\t\t\t     \"which does not exist.\"),\n> +\t\t\t   cmd);\n> +\t\tif (autocorrect < 0)\n> +\t\t\tfprintf_ln(stderr,\n> +\t\t\t\t   _(\"Continuing under the\n> assumption that \"\n> +\t\t\t\t     \"you meant '%s'.\"),\n> +\t\t\t\t   assumed);\n> +\t\telse {\n> +\t\t\tfprintf_ln(stderr,\n> +\t\t\t\t   _(\"Continuing in %0.1f seconds, \"\n> +\t\t\t\t     \"assuming that you meant\n> '%s'.\"),\n> +\t\t\t\t   (float)autocorrect/10.0,\n> assumed);\n>  \t\t\tsleep_millisec(autocorrect * 100);\n>  \t\t}\n>  \t\treturn assumed;\nExcuse me bringing this up after a long time. Was this patch applied?\nWhat's it's status?\n\n-- \nRegards,\nKaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n\n"},{"id":"322809","messageId":"20170621135738.27948-1-marcnarc@xiplink.com","threadId":"44728","inReplyTo":"3164ca01-9b54-3c9b-96d8-182c9fbbceb9@xiplink.com","subject":"[PATCHv2 (resend)] Tweak help auto-correct phrasing.","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2017-06-21T13:57:38Z","receivedAt":"2017-06-21T14:05:08Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"When auto-correct is enabled, an invalid git command prints a warning and\na continuation message, which differs depending on whether or not\nhelp.autoCorrect is positive or negative.\n\nWith help.autoCorrect = 15:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing under the assumption that you meant 'log'\n   in 1.5 seconds automatically...\n\nWith help.autoCorrect < 0:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing under the assumption that you meant 'log'\n\nThe continuation message's phrasing is awkward.  This commit cleans it up.\nAs a bonus, we now use full-sentence strings which make translation easier.\n\nWith help.autoCorrect = 15:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing in 1.5 seconds, assuming that you meant 'log'.\n\nWith help.autoCorrect < 0:\n\n   WARNING: You called a Git command named 'lgo', which does not exist.\n   Continuing under the assumption that you meant 'log'.\n\nSigned-off-by: Marc Branchaud <marcnarc@xiplink.com>\n---\n\nSo here's the patch again.\n\n\t\tM.\n\n help.c | 18 ++++++++++++------\n 1 file changed, 12 insertions(+), 6 deletions(-)\n\ndiff --git a/help.c b/help.c\nindex f637fc800..69966c174 100644\n--- a/help.c\n+++ b/help.c\n@@ -356,12 +356,18 @@ const char *help_unknown_cmd(const char *cmd)\n \t\tclean_cmdnames(&main_cmds);\n \t\tfprintf_ln(stderr,\n \t\t\t   _(\"WARNING: You called a Git command named '%s', \"\n-\t\t\t     \"which does not exist.\\n\"\n-\t\t\t     \"Continuing under the assumption that you meant '%s'\"),\n-\t\t\tcmd, assumed);\n-\t\tif (autocorrect > 0) {\n-\t\t\tfprintf_ln(stderr, _(\"in %0.1f seconds automatically...\"),\n-\t\t\t\t(float)autocorrect/10.0);\n+\t\t\t     \"which does not exist.\"),\n+\t\t\t   cmd);\n+\t\tif (autocorrect < 0)\n+\t\t\tfprintf_ln(stderr,\n+\t\t\t\t   _(\"Continuing under the assumption that \"\n+\t\t\t\t     \"you meant '%s'.\"),\n+\t\t\t\t   assumed);\n+\t\telse {\n+\t\t\tfprintf_ln(stderr,\n+\t\t\t\t   _(\"Continuing in %0.1f seconds, \"\n+\t\t\t\t     \"assuming that you meant '%s'.\"),\n+\t\t\t\t   (float)autocorrect/10.0, assumed);\n \t\t\tsleep_millisec(autocorrect * 100);\n \t\t}\n \t\treturn assumed;\n-- \n2.13.1.388.g69e6b9b4f.dirty\n\n"},{"id":"322888","messageId":"xmqqd19xm0m5.fsf@gitster.mtv.corp.google.com","threadId":"44728","inReplyTo":"20170621135738.27948-1-marcnarc@xiplink.com","subject":"Re: [PATCHv2 (resend)] Tweak help auto-correct phrasing.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-21T22:34:10Z","receivedAt":"2017-06-21T22:34:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marc Branchaud <marcnarc@xiplink.com> writes:\n\n> When auto-correct is enabled, an invalid git command prints a warning and\n> a continuation message, which differs depending on whether or not\n> help.autoCorrect is positive or negative.\n>\n> With help.autoCorrect = 15:\n>\n>    WARNING: You called a Git command named 'lgo', which does not exist.\n>    Continuing under the assumption that you meant 'log'\n>    in 1.5 seconds automatically...\n>\n> With help.autoCorrect < 0:\n>\n>    WARNING: You called a Git command named 'lgo', which does not exist.\n>    Continuing under the assumption that you meant 'log'\n>\n> The continuation message's phrasing is awkward.  This commit cleans it up.\n> As a bonus, we now use full-sentence strings which make translation easier.\n>\n> With help.autoCorrect = 15:\n>\n>    WARNING: You called a Git command named 'lgo', which does not exist.\n>    Continuing in 1.5 seconds, assuming that you meant 'log'.\n>\n> With help.autoCorrect < 0:\n>\n>    WARNING: You called a Git command named 'lgo', which does not exist.\n>    Continuing under the assumption that you meant 'log'.\n>\n> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n> ---\n>\n> So here's the patch again.\n\nThanks.  Will queue and wait for people to yell at us when this\nbreaks their setup (which I highly doubt would happen ;-).\n\n>  help.c | 18 ++++++++++++------\n>  1 file changed, 12 insertions(+), 6 deletions(-)\n>\n> diff --git a/help.c b/help.c\n> index f637fc800..69966c174 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -356,12 +356,18 @@ const char *help_unknown_cmd(const char *cmd)\n>  \t\tclean_cmdnames(&main_cmds);\n>  \t\tfprintf_ln(stderr,\n>  \t\t\t   _(\"WARNING: You called a Git command named '%s', \"\n> -\t\t\t     \"which does not exist.\\n\"\n> -\t\t\t     \"Continuing under the assumption that you meant '%s'\"),\n> -\t\t\tcmd, assumed);\n> -\t\tif (autocorrect > 0) {\n> -\t\t\tfprintf_ln(stderr, _(\"in %0.1f seconds automatically...\"),\n> -\t\t\t\t(float)autocorrect/10.0);\n> +\t\t\t     \"which does not exist.\"),\n> +\t\t\t   cmd);\n> +\t\tif (autocorrect < 0)\n> +\t\t\tfprintf_ln(stderr,\n> +\t\t\t\t   _(\"Continuing under the assumption that \"\n> +\t\t\t\t     \"you meant '%s'.\"),\n> +\t\t\t\t   assumed);\n> +\t\telse {\n> +\t\t\tfprintf_ln(stderr,\n> +\t\t\t\t   _(\"Continuing in %0.1f seconds, \"\n> +\t\t\t\t     \"assuming that you meant '%s'.\"),\n> +\t\t\t\t   (float)autocorrect/10.0, assumed);\n>  \t\t\tsleep_millisec(autocorrect * 100);\n>  \t\t}\n>  \t\treturn assumed;\n"}]}