summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-09-10ci: complete transition to GitHub Actionsag/moarciAndrew Gallant
test
2019-08-31ci: initial github actions configAndrew Gallant
2019-08-28ignore: remove unused parameterAndrew Gallant
2019-08-28deps: update everythingAndrew Gallant
2019-08-11deps: update bstr to 0.2.7Andrew Gallant
The new bstr release contains a small performance bug fix where some trivial methods weren't being inlined.
2019-08-09doc: use XDG_CONFIG_HOME in commentsTodd Walton
XDG_CONFIG_DIR does not actually exist. PR #1347
2019-08-07doc: update to reflect glob matching behavior changeLawAbidingCactus
Specifically, paths contains a `/` are not allowed to match any other slash in the path, even as a prefix. So `!.git` is the correct incantation for ignoring a `.git` directory that occurs anywhere in the path.
2019-08-06grep-regex-0.1.5grep-regex-0.1.5Andrew Gallant
2019-08-06grep-searcher-0.1.6grep-searcher-0.1.6Andrew Gallant
2019-08-06deps: update ignoreAndrew Gallant
2019-08-06ignore-0.4.10ignore-0.4.10Andrew Gallant
2019-08-06deps: drop tempfileAndrew Gallant
We were only using it to create temporary directories for `ignore` tests, but it pulls in a bunch of dependencies and we don't really need randomness. So just use our own simple wrapper instead.
2019-08-05deps: update everythingAndrew Gallant
Mostly this just updates regex and its assorted dependencies. This does drop utf8-ranges and ucd-util, in accordance with changes to regex-syntax and regex.
2019-08-04readme: Debian Buster is stable nowjimbo1qaz
PR #1338
2019-08-02changelog: update with bug fixAndrew Gallant
2019-08-02searcher: fix roll buffer bugAndrew Gallant
This commit fixes a subtle bug in how the line buffer was rolling its contents. Specifically, when ripgrep searches without memory maps, it uses a "roll" buffer for incremental line oriented search without needing to read the entire file into memory at once. The roll buffer works by reading a chunk of bytes from the file into memory, and then searching everything in that buffer up to the last `\n` byte. The bytes *after* the last `\n` byte are preserved, since they likely correspond to *part* of the next line. Once ripgrep is done searching the buffer, it "rolls" the buffer such that the start of the next line is at the beginning of the buffer, and then ripgrep reads more data into the buffer starting at the (possibly) partial end of that line. The implication of this strategy, necessarily so, is that a buffer must be big enough to fit a single line in memory. This is because the regex engine needs a contiguous block of memory to search, so there is no way to search anything smaller than a single line. So if a file contains a single line with 7.5 million bytes, then the buffer will grow to be at least that size. (Many files have super long lines like this, but they tend to be *binary* files, which ripgrep will detect and stop searching unless the user forces it with the `-a/--text` flag. So in practice, they aren't usually a problem. However, in this case, #1335 found a case where a plain text file had a line with 7.5 million bytes.) Now, for performance reasons, ripgrep reuses these buffers across its search. Typically, it will create `N` of these line buffers when it starts (where `N` is the number of threads it is using), and then reuse them without creating any new ones as it searches through files. This means that if you search a file with a very long line, that buffer will expand to be big enough to store that line. ripgrep never contracts these buffers, so once it searches the next file, ripgrep will continue to use this large buffer. While it might be prudent to contract these buffers in some circumstances, this isn't otherwise inherently a problem. The memory has already been allocated, and there isn't much cost to using it, other than the fact that ripgrep hangs on to it and never gives it back to the OS. However, the `roll` implementation described above had a really important bug in it that was impacted by the size of the buffer. Specifically, it used the following to "roll" the partial line at the end of the buffer to the beginning: self.buf.copy_within_str(self.pos.., 0); Which means that if the buffer is very large, ripgrep will copy *everything* from `self.pos` (which might be very small, e.g., for small files) to the end of the buffer, and move it to the beginning of the buffer. This will happen repeatedly each time the buffer is used to search small files, which winds up being quite a large slow down if the line was exceptionally large (say, megabytes). It turns out that copying everything is completely unnecessary. We only need to copy the remainder of the last read to the beginning of the buffer. Everything *after* the last read in the buffer is just free space that can be filled for the next read. So, all we need to do is copy just those bytes: self.buf.copy_within_str(self.pos..self.end, 0); ... which is typically much much smaller than the rest of the buffer. This was likely also causing small performance losses in other cases as well. For example, when searching a lot of small files, ripgrep would likely do a lot more copying than necessary. Although, given that the default buffer size is 8KB, this extra copying was likely pretty small, and was thus harder to observe. Fixes #1335
2019-08-01pkg: update brew tap to 11.0.2Andrew Gallant
2019-08-01ci: fix musl deployment11.0.2Andrew Gallant
The docker image that the Linux binary is now built in does not have ASCII doc installed, so setup Cross to point to my own image with those tools installed.
2019-08-01ripgrep: release 11.0.2Andrew Gallant
2019-08-01src: remove old directoriesAndrew Gallant
termcolor has had its own repository for a while now. No need for these redirects any more.
2019-08-01ignore: release 0.4.9ignore-0.4.9Andrew Gallant
2019-08-01grep-regex: release 0.1.4grep-regex-0.1.4Andrew Gallant
2019-08-01grep-matcher: release 0.1.3grep-matcher-0.1.3Andrew Gallant
2019-08-01changelog: start work on 11.0.2 releaseAndrew Gallant
2019-08-01deps: update everythingAndrew Gallant
This drops `spin` and `autocfg`, yay.
2019-08-01doc: mention .ignore and .rgignore more prominentlyAndrew Gallant
Fixes #1284
2019-08-01doc: add translations sectionAndrew Gallant
We note that they may not be up to date and are unofficial. Fixes #1246
2019-08-01doc: improve PCRE2 failure mode documentationAndrew Gallant
If a user tries to search for an explicit `\n` character in a PCRE2 regex, ripgrep won't report an error and instead will (likely) silently fail to match. Fixes #1261
2019-08-01ripgrep: fix bug when CWD has directory named `-`Ninan John
Specifically, when searching stdin, if the current directory has a directory named `-`, then the `--with-filename` flag would automatically be turned on. This is because `--with-filename` is automatically enabled when ripgrep is given a single path that is a directory. When ripgrep is given empty arguments, and if it is searching stdin, then its default path list is just simple `["-"]`. The `is_dir` check passes, and `--with-filename` gets enabled. This commit fixes the problem by checking whether the path is `-` first. If so, then we assume it isn't a directory. This is fine, since if it is a directory and one asks to search it explicitly, then ripgrep will interpret `-` as stdin anyway (which is arguably a bug on its own, but probably not one worth fixing). Fixes #1223, Closes #1292
2019-08-01ripgrep: add --glob-case-insensitivedana
This flag forces -g/--glob patterns to be treated case-insensitively, as with --iglob patterns. Fixes #1293
2019-08-01regex: fix -F aho-corasick optimizationAndrew Gallant
It turns out that when the -F flag was used, if any of the patterns contained a regex meta character (such as `.`), then we winded up escaping the pattern first before handing it off to Aho-Corasick, which treats all patterns literally. We continue to apply band-aides here and just avoid Aho-Corasick if there is an escape in any of the literal patterns. This is unfortunate, but making this work better requires more refactoring, and the right solution is to get this optimization pushed down into the regex engine. Fixes #1334
2019-07-29ignore/types: add edn type from Clojure ecosystemMatthew Davidson
PR #1330
2019-07-25deps: update themAndrew Gallant
There are some nice removals. It looks like rand has slimmed down, and smallvec is gone now as well.
2019-07-24deps: bump ignoreAndrew Gallant
2019-07-24ignore-0.4.8ignore-0.4.8Andrew Gallant
2019-07-24ignore: support compilation on wasmTiziano Santoro
Currently the crate assumes that exactly one of `cfg(windows)` or `cfg(unix)` is true, but this is not actually the case, for instance when compiling for `wasm32`. Implement the missing functions so that the crate can compile on other platforms, even though those functions will always return an error. PR #1327
2019-07-20readme: fix broken link to Scoop bucketMiloš Stojanović
PR #1324
2019-07-14ignore/types: add Robot FrameworkConrad Olega
PR #1322
2019-07-04doc: improve docs for --replace flagHugo Locurcio
Specifically, we document shell-specific caveats related to the `--replace` flag. PR #1318
2019-06-26release: globset, grep-cli, grep-printer, grep-searchergrep-searcher-0.1.5grep-printer-0.1.3grep-cli-0.1.3globset-0.4.4Andrew Gallant
2019-06-26deps: update everythingAndrew Gallant
2019-06-26bstr: update everything to bstr 0.2Andrew Gallant
2019-06-18search: a few small touchupsAndrew Gallant
2019-06-16search: better errors for preprocessor commandsAndrew Gallant
If a preprocessor command could not be started, we now show some additional context with the error message. Previously, it showed something like this: some/file: No such file or directory (os error 2) Which is itself pretty misleading. Now it shows: some/file: preprocessor command could not start: '"nonexist" "some/file"': No such file or directory (os error 2) Fixes #1302
2019-06-16deps: update everythingAndrew Gallant
2019-06-16style: fix deprecationsAndrew Gallant
Use `dyn` for trait objects and use `..=` for inclusive ranges.
2019-06-12ignore/types: add more nim typesHitesh Jasani
PR #1297
2019-06-01doc: point regex doc link to the latest versionskierpage
The latest doc is different, e.g. adds "symmetric differences" under https://docs.rs/regex/*/regex/#character-classes PR #1287
2019-05-29ignore: remove .git check in some casesAndrew Gallant
When we know we aren't going to process gitignores, we shouldn't waste the syscall in every directory to check for a git repo.
2019-05-29readme: mention Zstandard and Brotlibruce-one
Also alphabetise the list. PR #1288