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

2017-06-20 Thread Kaartic Sivaraam
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 
> ---
> 
> 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(_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 



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

2017-06-20 Thread Marc Branchaud

On 2017-06-20 02:04 PM, Kaartic Sivaraam wrote:

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 
---


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.ca...@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.



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

2017-06-20 Thread Kaartic Sivaraam
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 
> ---
> 
Excuse me for bringing this up after a long time. What's the status of
this patch? Was it applied?

-- 
Regards,
Kaartic Sivaraam 


[PATCHv2] Tweak help auto-correct phrasing.

2016-12-20 Thread Marc Branchaud
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 
---

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(_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