git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Drew DeVault" <sir@cmpwn.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: <git@vger.kernel.org>, "lanodan" <contact+git@hacktivis.me>
Subject: Re: [PATCH v3] help.c: configurable suggestions
Date: Wed, 18 Nov 2020 12:17:43 -0500	[thread overview]
Message-ID: <C76K6Q09ATLR.1OI5KW390LKFX@taiga> (raw)
In-Reply-To: <xmqqima237qt.fsf@gitster.c.googlers.com>

On Wed Nov 18, 2020 at 12:16 PM EST, Junio C Hamano wrote:
> It is unclear from this description alone why this is needed. The
> seller of this change needs to emphasize how this is better than
> setting the variable to "0" (do not autocorrect). My guess is that
> some users do not even need the suggestion of correct spelling when
> they made a typo?

This is one reason. Another is that spell checking can be
computationally expensive, and take an annoyingly long time on low-end
devices.

> > @@ -706,10 +725,16 @@ NORETURN void help_unknown_ref(const char *ref, const char *cmd,
> >  			       const char *error)
> >  {
> >  	int i;
> > -	struct string_list suggested_refs = guess_refs(ref);
> > +	struct string_list suggested_refs;
> >  
> >  	fprintf_ln(stderr, _("%s: %s - %s"), cmd, ref, error);
> >  
> > +	if (autocorrect == AUTOCORRECT_NEVER) {
> > +		exit(1);
> > +	}
>
> I am not sure how the change in this hunk is justifiable.

I think this was caught up in the move from a new config option to
changing the meaning of help.autocorrect.

> This is a tangent, but it seems to me that help_unknown_ref() is way
> under-used and lacks usefulness too much---probably these contribute
> to each other.

Given that this is under-utilized anyway, and no longer applicable to
the essential purpose of the patch, I'm just going to pull this change
out of the patch. If this function starts to enjoy broader usage within
git, we could revisit a config lever later on.

Thanks for the feedback, sending v4 shortly.

  reply	other threads:[~2020-11-18 17:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 14:42 [PATCH v3] help.c: configurable suggestions Drew DeVault
2020-11-18 17:16 ` Junio C Hamano
2020-11-18 17:17   ` Drew DeVault [this message]
2020-11-18 17:46     ` Junio C Hamano
2020-11-18 18:27     ` Ævar Arnfjörð Bjarmason

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=C76K6Q09ATLR.1OI5KW390LKFX@taiga \
    --to=sir@cmpwn.com \
    --cc=contact+git@hacktivis.me \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).