1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-10 08:26:10 +02:00

Merge branch 'ds/grep-doc-updates' into next

Documentation updates.

* ds/grep-doc-updates:
  grep docs: describe --no-index further and improve formatting a bit
  grep docs: describe --recurse-submodules further and improve formatting a bit
This commit is contained in:
Junio C Hamano 2024-03-27 10:13:03 -07:00
commit 681f08cbc5
2 changed files with 23 additions and 15 deletions

View File

@ -24,5 +24,5 @@ grep.fullName::
If set to true, enable `--full-name` option by default. If set to true, enable `--full-name` option by default.
grep.fallbackToNoIndex:: grep.fallbackToNoIndex::
If set to true, fall back to git grep --no-index if git grep If set to true, fall back to `git grep --no-index` if `git grep`
is executed outside of a git repository. Defaults to false. is executed outside of a git repository. Defaults to false.

View File

@ -28,7 +28,7 @@ SYNOPSIS
[-f <file>] [-e] <pattern> [-f <file>] [-e] <pattern>
[--and|--or|--not|(|)|-e <pattern>...] [--and|--or|--not|(|)|-e <pattern>...]
[--recurse-submodules] [--parent-basename <basename>] [--recurse-submodules] [--parent-basename <basename>]
[ [--[no-]exclude-standard] [--cached | --no-index | --untracked] | <tree>...] [ [--[no-]exclude-standard] [--cached | --untracked | --no-index] | <tree>...]
[--] [<pathspec>...] [--] [<pathspec>...]
DESCRIPTION DESCRIPTION
@ -45,13 +45,21 @@ OPTIONS
Instead of searching tracked files in the working tree, search Instead of searching tracked files in the working tree, search
blobs registered in the index file. blobs registered in the index file.
--no-index::
Search files in the current directory that is not managed by Git.
--untracked:: --untracked::
In addition to searching in the tracked files in the working In addition to searching in the tracked files in the working
tree, search also in untracked files. tree, search also in untracked files.
--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 pathspec patterns to limit paths; see the 'pathspec' entry
in linkgit:gitglossary[7] for more information.
+
This option cannot be used together with `--cached` or `--untracked`.
See also `grep.fallbackToNoIndex` in 'CONFIGURATION' below.
--no-exclude-standard:: --no-exclude-standard::
Also search in ignored files by not honoring the `.gitignore` Also search in ignored files by not honoring the `.gitignore`
mechanism. Only useful with `--untracked`. mechanism. Only useful with `--untracked`.
@ -64,9 +72,9 @@ OPTIONS
--recurse-submodules:: --recurse-submodules::
Recursively search in each submodule that is active and Recursively search in each submodule that is active and
checked out in the repository. When used in combination with the checked out in the repository. When used in combination with the
<tree> option the prefix of all submodule output will be the name of _<tree>_ option the prefix of all submodule output will be the name of
the parent project's <tree> object. This option has no effect the parent project's _<tree>_ object. This option cannot be used together
if `--no-index` is given. with `--untracked`, and it has no effect if `--no-index` is specified.
-a:: -a::
--text:: --text::
@ -178,7 +186,7 @@ providing this option will cause it to die.
Use \0 as the delimiter for pathnames in the output, and print Use \0 as the delimiter for pathnames in the output, and print
them verbatim. Without this option, pathnames with "unusual" them verbatim. Without this option, pathnames with "unusual"
characters are quoted as explained for the configuration characters are quoted as explained for the configuration
variable core.quotePath (see linkgit:git-config[1]). variable `core.quotePath` (see linkgit:git-config[1]).
-o:: -o::
--only-matching:: --only-matching::
@ -248,8 +256,8 @@ providing this option will cause it to die.
a non-zero status. a non-zero status.
--threads <num>:: --threads <num>::
Number of grep worker threads to use. Number of `grep` worker threads to use. See 'NOTES ON THREADS'
See `grep.threads` in 'CONFIGURATION' for more information. and `grep.threads` in 'CONFIGURATION' for more information.
-f <file>:: -f <file>::
Read patterns from <file>, one per line. Read patterns from <file>, one per line.
@ -332,13 +340,13 @@ EXAMPLES
NOTES ON THREADS NOTES ON THREADS
---------------- ----------------
The `--threads` option (and the grep.threads configuration) will be ignored when The `--threads` option (and the `grep.threads` configuration) will be ignored when
`--open-files-in-pager` is used, forcing a single-threaded execution. `--open-files-in-pager` is used, forcing a single-threaded execution.
When grepping the object store (with `--cached` or giving tree objects), running When grepping the object store (with `--cached` or giving tree objects), running
with multiple threads might perform slower than single threaded if `--textconv` with multiple threads might perform slower than single-threaded if `--textconv`
is given and there are too many text conversions. So if you experience low is given and there are too many text conversions. Thus, if low performance is
performance in this case, it might be desirable to use `--threads=1`. experienced in this case, it might be desirable to use `--threads=1`.
CONFIGURATION CONFIGURATION
------------- -------------