Repository navigation
This release breaks the command line and the index of v0.1.0. Rebuild every
index, and read the table below before you script a search. Details are in
docs/usage.md.
Breaking changes
- An index of v0.1.0 is refused: remove
.fmgrepand runfmgrep indexagain. The format is now 9. - The manifest is
manifest.binnow: read it withfmgrep status --json, notjq. - An index holds the files that
rg --fileslists, minus binary files. Ignored and symlinked files are now left out, as hidden files already were. - A PATTERN is a regex, as in rg.
-Fmakes it text. The slashes of/re/are now text. - The first argument is the PATTERN and every other is a PATH, as in rg. Give several patterns with
-e. - A PATH that does not exist, or that the index lacks, is an error (exit 2). The other PATHs are still searched.
- An empty pattern matches every line, as in rg.
- Piped output prints
path:text, with no headings and no line numbers, as rg does. fmgrep statusis a command: search for the word withfmgrep -- status. The flag--statusis gone.fmgrep serveneeds watchman, and exits 2 without it. Pass--no-watchto serve a tree that does not change.- On a tree of 50,000 files or more, fmgrep starts a watchman daemon when none runs (docs/watchman.md).
FMGREP_JOURNALis ignored. PointWATCHMAN_SOCKat a path where no daemon listens to keep fmgrep away from watchman.- The serve protocol changed: use one fmgrep version on client and server (docs/protocol.md).
--jsonand--approx-countsof several-epatterns report one expression, with a line for each pattern.- The library no longer exports
regex_pattern.
| v0.1.0 | now |
|---|---|
fmgrep 'a.b' finds the text a.b |
fmgrep -F 'a.b'; 'a.b' also finds axb |
fmgrep '/Dyn[A-Z]\w+/' |
fmgrep 'Dyn[A-Z]\w+' |
fmgrep A B searched for A and for B |
fmgrep -e A -e B: one search, the lines with either |
fmgrep --and A B |
fmgrep --and -e A -e B |
fmgrep A nope.txt also searched for nope.txt |
error: nope.txt: No such file or directory, exit 2 |
fmgrep --server ADDR --status |
fmgrep status --server ADDR --json |
--expr does not change: a word is a literal and /re/ a regex.
New
-e/--regexp,-F/--fixed-strings,-s/--case-sensitiveand-S/--smart-case, as in rg.-w/--word-regexpand-x/--line-regexp, as in rg.--no-ignore,-u,--hidden,-L,-a,-z,--pre,-Eand-vare refused with a reason, not as an unexpected argument.cargo install fmgrepneeds no C compiler.FMGREP_SERVER=HOST:PORTsearches a sharedfmgrep servefrom your own checkout, with your local edits, new files and commits included (docs/shared-server.md).--ignore-local-changesprints the server's answer alone.- Through a server, a PATH into another checkout searches that checkout when it holds the served commit. Otherwise the search says why.
- A search warns when it must ignore your local changes, and says why.
- A local
.fmgrepabove the cwd wins overFMGREP_SERVER, with a warning. It is also used when--servercannot be reached. fmgrep index --store-docsof a git checkout records the commit it holds.--require-served-commitmakes that an error when it cannot.fmgrep statussays which index or server a search uses, what it holds and what changed since the build (docs/usage.md).--statsprints rg's statistics after the matched lines.- Files that start with a UTF-16 byte order mark are indexed and searched, as in rg.
- A file new since the index that a search cannot read gets a warning, as an indexed file does. It used to drop out silently.
- A search that cannot use watchman says why, once, and checks every file.
- An ignore file edited after the index applies to the next search, with a warning.
FMGREP_VERBOSE=1prints how long each phase of a search took.
Faster
- The index is about half the size: 2.2 GB on Chromium, down from 4.6 GB (BENCHMARKS.md).
- A regex with a literal in it reads far fewer files.
- A
-isearch with a PATH or a glob is faster. - A search without a server opens its index sooner.
- A search waits at most 100 ms for watchman's answer, not 1 to 5 s.
- Finding the daemon can add up to 500 ms, when no earlier search left a record of it.
Fixed
- Output matches rg for adjacent coloured matches, empty
-omatches,--json -Uand-o '\A...'. fmgrep indexno longer fails on a file name with a backslash in it.- A file over 2 GiB is skipped with a warning. It failed the whole index.
fmgrep indexleaves out a file deleted while it runs, with a warning, instead of failing with exit 2.fmgrep serveasks watchman before each query, so a query no longer misses a change saved just before it.- A search could miss a change while watchman was still reading the tree.
- A tree on NFS, or shared by a virtual machine, is checked in full: watchman does not see edits made elsewhere.
fmgrep indexof a big tree no longer waits 5 s for watchman, and later searches stay fast.- A query that panics in
fmgrep servenow gets error -32603, and the server goes on serving other queries. - A served search that fails mid-way prints what it found, then the error, as a local search does.
- An idle
fmgrep serveon Linux no longer keeps 8 cores busy and grows by 550 MB. - A file that two PATHs reach, or a PATH given twice, prints once for each PATH, as in rg. It printed once.
Install: cargo install fmgrep