All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dragan Simic <dsimic@manjaro.org>
Cc: git@vger.kernel.org,  sunshine@sunshineco.com,  jn.avila@free.fr
Subject: Re: [PATCH v2 3/3] grep docs: describe --no-index further and improve formatting a bit
Date: Mon, 25 Mar 2024 12:18:16 -0700	[thread overview]
Message-ID: <xmqqa5mmjf2f.fsf@gitster.g> (raw)
In-Reply-To: <a7e5151fa615d572ab4ed05519dd277048ce935c.1711302588.git.dsimic@manjaro.org> (Dragan Simic's message of "Sun, 24 Mar 2024 18:51:13 +0100")

Dragan Simic <dsimic@manjaro.org> writes:

> +--no-index::
> +	Search files in the current directory that is not managed by Git,
> +	or by ignoring that the current directory is managed by Git.  This
> +	is rather similar to running the regular `grep(1)` utility with its
> +	`-r` option specified, but with some additional benefits, such as
> +	using multiple worker threads to speed up searches.

Sorry for not mentioning this earlier, but I do not think
multi-threaded grep has to be something we own and others cannot
implement.  A richer pathspec globbing [*1*] and logical operation
on match results may be better examples of "additional benefits" if
we really wanted to mention why people might want to use
"--no-index" in a directory that is outside Git.

[Footnote]

 *1* When you want to look for something in files whose name begins
     with "g" but does not have "rc" in it, you'd do

     $ git grep --no-index -c . ':(exclude)*rc*' 'g*'

> ++
> +This option cannot be used together with `--cached` or `--untracked`.
> +See also `grep.fallbackToNoIndex` in 'CONFIGURATION' below.
> +

OK.

>  --threads <num>::
> -	Number of grep worker threads to use.
> -	See `grep.threads` in 'CONFIGURATION' for more information.
> +	Number of `grep` worker threads to use, to speed up searches.
> +	See 'NOTES ON THREADS' and `grep.threads` in 'CONFIGURATION'
> +	for more information.

I actually do not think adding ", to speed up searches" is an
improvement.  But referring to NOTES ON THREADS is a good idea, and
by reading that NOTES ON THREADS section, readers can tell why it
sometimes does not speed things up or even slow them down.

Other than that, looking great.

Thanks.

  reply	other threads:[~2024-03-25 19:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-24 17:51 [PATCH v2 0/3] Assorted improvements salvaged from an earlier series Dragan Simic
2024-03-24 17:51 ` [PATCH v2 1/3] grep: perform some minor code and comment cleanups Dragan Simic
2024-03-25 21:03   ` Junio C Hamano
2024-03-25 21:17     ` Dragan Simic
2024-03-25 21:28       ` Junio C Hamano
2024-03-24 17:51 ` [PATCH v2 2/3] grep docs: describe --recurse-submodules further and improve formatting a bit Dragan Simic
2024-03-25 19:06   ` Junio C Hamano
2024-03-25 19:46     ` Dragan Simic
2024-03-24 17:51 ` [PATCH v2 3/3] grep docs: describe --no-index " Dragan Simic
2024-03-25 19:18   ` Junio C Hamano [this message]
2024-03-25 19:53     ` Dragan Simic

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

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

  git send-email \
    --in-reply-to=xmqqa5mmjf2f.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    --cc=sunshine@sunshineco.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.