REPO(1) Repo Manual REPO(1)

repo - repo grep - manual page for repo grep

repo grep {pattern | -e pattern} [<project>...]

Summary

Print lines matching a pattern

show this help message and exit
number of jobs to run in parallel (default: based on number of CPU cores)

show all output
only show errors

operate starting at the outermost manifest
do not operate on outer manifests
only operate on this (sub)manifest
operate on this manifest and its submanifests

Search the index, instead of the work tree
Search TREEish, instead of the work tree

Pattern to search for
Ignore case differences
Process binary files as if they were text
Don't match the pattern in binary files
Match the pattern only at word boundaries
Select non-matching lines
Use POSIX basic regexp for patterns (default)
Use POSIX extended regexp for patterns
Use fixed strings (not regexp) for pattern

Limit match to lines that have all patterns
Boolean operators to combine patterns
-(, -)
Boolean operator grouping

Prefix the line number to matching lines
Show CONTEXT lines around match
Show CONTEXT lines before match
Show CONTEXT lines after match
Show only file names containing matching lines
Show only file names not containing matching lines

Run `repo help grep` to view the detailed manual.

Search for the specified patterns in all project files.

Boolean Options

The following options can appear as often as necessary to express the pattern to locate:

-e PATTERN

--and, --or, --not, -(, -)

Further, the -r/--revision option may be specified multiple times in order to scan multiple trees. If the same file matches in more than one tree, only the first result is reported, prefixed by the revision name it was found under.

Examples

Look for a line that has '#define' and either 'MAX_PATH or 'PATH_MAX':

repo grep -e '#define' --and -\( -e MAX_PATH -e PATH_MAX \)

Look for a line that has 'NODE' or 'Unexpected' in files that contain a line that matches both expressions:

repo grep --all-match -e NODE -e Unexpected
July 2022 repo grep