Expand description
In-repo code search: a bounded, unindexed git grep over the default
branch, plus path-name matches.
Follows the JSS forge searchData / searchPage / apiSearch
behaviour (cited by name only). The query is a literal, case-insensitive
substring (git grep -I -n -i -F -z -e <q>): argv only, never a shell,
never a regex, and the query always follows -e so it cannot be read as
an option. Bounds: query 256 chars, 100 hits, 100 path matches, 5 hits per
file, 200-char excerpts.
Structs§
- Search
Match - One matching line.
- Search
Result - The result of one search.
Constants§
- SEARCH_
EXCERPT_ CAP - Characters kept of each matching line.
- SEARCH_
HIT_ CAP - Maximum returned grep hits.
- SEARCH_
PATH_ CAP - Maximum returned path matches.
- SEARCH_
PER_ FILE_ CAP git grep --max-countper file.- SEARCH_
QUERY_ CAP - Maximum query length in characters.
Functions§
- parse_
grep - Parse the NUL-framed
git grep -z -noutput (<tree>:<path>\0<line>\0<text>\n). - search_
data - Run a search over
branchof the bare repo atdir.