git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] help.c: configurable suggestions

From
Drew DeVault <sir@cmpwn.com>
Date
Nov 17, 2020, 20:05 UTC
Message-ID
<C75T4RXIM970.2CVY5MIDCX25Q@taiga>
In-Reply-To
<xmqqd00b698g.fsf@gitster.c.googlers.com>
On Tue Nov 17, 2020 at 3:04 PM EST, Junio C Hamano wrote:
Show 7 quoted lines
> Drew DeVault <sir@cmpwn.com> writes:
>
> > This allows users to disable guessing the commands or options that they
> > meant to use.
> > ---
>
> Missing sign-off.
Whoops!
Show 7 quoted lines
> This changes behaviour for those who have relied on our promise that
> any negative value means immediate execution. Now -2 means a totally
> different thing.
>
> I thought I already showed you how to make it a "number or keyword"
> in my previous review comment to avoid such a needless behaviour
> change---did our mails cross?

I must not have understood the psuedocode you sent. I'll take another look at it. Thanks for the feedback!

Show 8 quoted lines
> > @@ -586,7 +597,7 @@ const char *help_unknown_cmd(const char *cmd)
> >  		     n++)
> >  			; /* still counting */
> >  	}
> > -	if (autocorrect && n == 1 && SIMILAR_ENOUGH(best_similarity)) {
> > +	if (autocorrect != 0 && n == 1 && SIMILAR_ENOUGH(best_similarity)) {
>
> I see there is nothing gained by writing "!= 0" explicitly here.
*shrug*
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “help.c: configurable suggestions”
  1. help.c: configurable suggestionsDrew DeVault, Nov 17, 2020
  2. Junio C HamanoNov 17, 2020
  3. Drew DeVaultNov 17, 2020
  4. Junio C HamanoNov 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.