summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-11-20Make wincolor crate compilable on non-Windows platforms.wincolor-0.1.0termcolor-0.1.0Andrew Gallant
2016-11-20Get rid of special mmap decision on Windows.Andrew Gallant
I spent some quality time on my Windows 10 laptop and it appears to suffer from a similar trade-off as on Linux: mmaps are bad for large directory traversals but good for single large files. Darwin continues to reject memory maps in all cases (unless explicitly requested), but more testing should be done there.
2016-11-20Propagate no_messages option to worker.Andrew Gallant
Fixes #241
2016-11-20Merge pull request #240 from BurntSushi/colorAndrew Gallant
Completely re-work colored output and tty handling.
2016-11-20Completely re-work colored output and tty handling.Andrew Gallant
This commit completely guts all of the color handling code and replaces most of it with two new crates: wincolor and termcolor. wincolor provides a simple API to coloring using the Windows console and termcolor provides a platform independent coloring API tuned for multithreaded command line programs. This required a lot more flexibility than what the `term` crate provided, so it was dropped. We instead switch to writing ANSI escape sequences directly and ignore the TERMINFO database. In addition to fixing several bugs, this commit also permits end users to customize colors to a certain extent. For example, this command will set the match color to magenta and the line number background to yellow: rg --colors 'match:fg:magenta' --colors 'line:bg:yellow' foo For tty handling, we've adopted a hack from `git` to do tty detection in MSYS/mintty terminals. As a result, ripgrep should get both color detection and piping correct on Windows regardless of which terminal you use. Finally, switch to line buffering. Performance doesn't seem to be impacted and it's an otherwise more user friendly option. Fixes #37, Fixes #51, Fixes #94, Fixes #117, Fixes #182, Fixes #231
2016-11-19Rename --files-without-matches to --files-without-match.Andrew Gallant
This is to be consistent with grep.
2016-11-19Merge pull request #239 from mernen/files-without-matchesAndrew Gallant
Add --files-without-matches flag.
2016-11-19Add --files-without-matches flag.Daniel Luz
Performs the opposite of --files-with-matches: only shows paths of files that contain zero matches. Closes #138
2016-11-18Merge pull request #238 from jacwah/refactorAndrew Gallant
`Ignore` refactorings
2016-11-17Fix stdin bug with --file.Andrew Gallant
When `rg -f-` is used, the default search path should be `./` and not `-`.
2016-11-17Fix issue number mixup.Andrew Gallant
Thanks @bluss!
2016-11-17Merge pull request #233 from BurntSushi/clapAndrew Gallant
Switch from Docopt to Clap.
2016-11-17Switch from Docopt to Clap.Andrew Gallant
There were two important reasons for the switch: 1. Performance. Docopt does poorly when the argv becomes large, which is a reasonable common use case for search tools. (e.g., use with xargs) 2. Better failure modes. Clap knows a lot more about how a particular argv might be invalid, and can therefore provide much clearer error messages. While both were important, (1) made it urgent. Note that since Clap requires at least Rust 1.11, this will in turn increase the minimum Rust version supported by ripgrep from Rust 1.9 to Rust 1.11. It is therefore a breaking change, so the soonest release of ripgrep with Clap will have to be 0.3. There is also at least one subtle breaking change in real usage. Previous to this commit, this used to work: rg -e -foo Where this would cause ripgrep to search for the string `-foo`. Clap currently has problems supporting this use case (see: https://github.com/kbknapp/clap-rs/issues/742), but it can be worked around by using this instead: rg -e [-]foo or even rg [-]foo and this still works: rg -- -foo This commit also adds Bash, Fish and PowerShell completion files to the release, fixes a bug that prevented ripgrep from working on file paths containing invalid UTF-8 and shows short descriptions in the output of `-h` but longer descriptions in the output of `--help`. Fixes #136, Fixes #189, Fixes #210, Fixes #230
2016-11-17Use env::home_dir() instead of env::var_os(HOME).Andrew Gallant
Thanks @steveklabnik!
2016-11-15Merge pull request #227 from emk/issue-7Andrew Gallant
Allow specifying patterns with `-f FILE` and `-f-`
2016-11-15Allow specifying patterns with `-f FILE` and `-f-`Eric Kidd
This is a somewhat basic implementation of `-f-` (#7), with unit tests. Changes include: 1. The internals of the `pattern` function have been refactored to avoid code duplication, but there's a lot more we could do. Right now we read the entire pattern list into a `Vec`. 2. There's now a `WorkDir::pipe` command that allows sending standard input to `rg` when testing. Not implemented: aho-corasick.
2016-11-15Merge pull request #235 from jinyeow/masterAndrew Gallant
Added elixir to types
2016-11-15Added elixir to typesJustin Puah
2016-11-11Disable symlink tests on Windows.Andrew Gallant
For some reason, these work on AppVeyor but not in other build systems. Let's just disable them. See: https://github.com/rust-lang/rust/pull/37149
2016-11-09Pin rustc-serialize to 0.3.19.0.2.9Andrew Gallant
See: https://github.com/rust-lang-nursery/rustc-serialize/pull/159
2016-11-090.2.9Andrew Gallant
2016-11-09update depsAndrew Gallant
2016-11-09ignore-0.1.5ignore-0.1.5Andrew Gallant
2016-11-09changelog 0.2.9Andrew Gallant
2016-11-09Rework parallelism in directory iterator.Andrew Gallant
Previously, ignore::WalkParallel would invoke the callback for all *explicitly* given file paths in a single thread, which effectively meant that `rg pattern foo bar baz ...` didn't actually search foo, bar and baz in parallel. The code was structured that way to avoid spinning up workers if no directory paths were given. The original intention was probably to have a separate pool of threads responsible for searching, but ripgrep ended up just reusing the ignore::WalkParallel workers themselves for searching, and thereby subjected to its sub-par performance in this case. The code has been restructured so that file paths are sent to the workers, which brings back parallelism. Fixes #226
2016-11-09Fix a bug with handling --ignore-file.Andrew Gallant
Namely, passing a directory to --ignore-file caused ripgrep to allocate memory without bound. The issue was that I got a bit overzealous with partial error reporting. Namely, when processing a gitignore file, we should try to use every pattern even if some patterns are invalid globs (e.g., a**b). In the process, I applied the same logic to I/O errors. In this case, it manifest by attempting to read lines from a directory, which appears to yield Results forever, where each Result is an error of the form "you can't read from a directory silly." Since I treated it as a partial error, ripgrep was just spinning and accruing each error in memory, which caused the OOM killer to kick in. Fixes #228
2016-11-06rewordAndrew Gallant
2016-11-06rewordAndrew Gallant
2016-11-06ucg author says it's not a bug per seAndrew Gallant
2016-11-06Don't ever search directories.Andrew Gallant
2016-11-06touchupsAndrew Gallant
2016-11-06typoAndrew Gallant
2016-11-06Always search paths given by user.Andrew Gallant
This permits doing `rg -a test /dev/sda1` for example, where as before /dev/sda1 was skipped because it wasn't a regular file.
2016-11-06touchupsAndrew Gallant
2016-11-06touchupsAndrew Gallant
2016-11-06touchupsAndrew Gallant
2016-11-06touchupsAndrew Gallant
2016-11-06Update README with more/updated benchmarksAndrew Gallant
2016-11-06Update brew tap.Andrew Gallant
2016-11-060.2.80.2.8Andrew Gallant
2016-11-06changelog 0.2.8Andrew Gallant
2016-11-06simd-accel should not invoke avx-accel.Andrew Gallant
This was a silly transcription error.
2016-11-060.2.70.2.7Andrew Gallant
2016-11-06changelog 0.2.7Andrew Gallant
2016-11-06Update sub-crate dependency versions.Andrew Gallant
2016-11-06ignore-0.1.4ignore-0.1.4Andrew Gallant
2016-11-06grep-0.1.4grep-0.1.4Andrew Gallant
2016-11-06globset-0.1.2globset-0.1.2Andrew Gallant
2016-11-06Add --no-messages flag.Andrew Gallant
This flag is similar to what's found in grep: it will suppress all error messages, such as those shown when a particular file couldn't be read. Closes #149
2016-11-06Add -m/--max-count flag.Andrew Gallant
This flag limits the number of matches printed *per file*. Closes #159