Scroll to navigation

REPO(1) Repo Manual REPO(1)

NAME

repo - repo grep - manual page for repo grep

SYNOPSIS

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

DESCRIPTION

Summary

Print lines matching a pattern

OPTIONS

show this help message and exit
number of jobs to run in parallel (default: 4)
Logging options:
show all output
only show errors
Sources:
Search the index, instead of the work tree
Search TREEish, instead of the work tree
Pattern:
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
Pattern Grouping:
Limit match to lines that have all patterns
Boolean operators to combine patterns
-(, -)
Boolean operator grouping
Output:
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.

Description

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
June 2021 repo grep