1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-06-25 14:22:54 +02:00
Commit Graph

1422 Commits

Author SHA1 Message Date
1bb30b72fc changelog: prepare for 12.0.1 release, redux 2020-03-29 18:50:31 -04:00
09a4b75baf ignore-0.4.14 ignore-0.4.14 2020-03-29 18:49:01 -04:00
58c428827d changelog: prepare for 12.0.1 release 2020-03-29 18:47:46 -04:00
b9bb04b793 deps: minor dependency updates 2020-03-29 18:47:15 -04:00
4dfea016b9 ignore/types: add ebuild type
Add support for Gentoo's portage package manager spec files:
https://wiki.gentoo.org/wiki/Portage
2020-03-29 18:44:04 -04:00
3193d57ac1 ci: attempt to fix CI
It looks like a2x isn't working, so take a shot at fixing it.
2020-03-28 21:36:29 -04:00
67c0f576b6 ignore-0.4.13 ignore-0.4.13 2020-03-22 21:08:37 -04:00
543f99dbf1 grep-regex-0.1.7 grep-regex-0.1.7 2020-03-22 21:08:19 -04:00
0ea65efd6d regex: special case literal extraction
In a prior commit, we fixed a performance problem with the -w flag by
doing a little extra work to extract literals. It turns out that using
literals in this case when the -w flag is NOT used results in a
performance regression. The reasoning is that we end up using a "fast"
regex as a prefilter when the regex engine itself uses its own
equivalent prefilter, so ripgrep ends up redoing a fair amount of work.

Instead, we only do this extra work when we know the -w flag is enabled.
2020-03-22 21:02:51 -04:00
20deae6497 tests: fix typo in test name
PR #1528
2020-03-22 07:43:16 -04:00
655e33219a crates.io: remove badges
... and don't replace them with anything because crates.io does not
support GitHub Actions yet. But it's almost there:
https://github.com/rust-lang/crates.io/pull/1838

Thanks @atouchet for noticing this.
2020-03-17 17:50:37 -04:00
8ba6ccd159 ignore: fix failing test
This fixes fallout from fixing #1520.
2020-03-16 19:16:24 -04:00
34edb8123a ignore: squash noisy error message
We should not assume that the commondir file actually exists. If it
doesn't, then just move on. This otherwise emits an error message when
searching normal submodules, which is not OK.

This regression was introduced in #1446.

Fixes #1520
2020-03-16 18:50:02 -04:00
5b30c2aed6 ci: fix deb build script 2020-03-15 22:11:32 -04:00
bf1027a83e pkg: update brew tap to 12.0.0 2020-03-15 22:10:08 -04:00
031264e5fb ci: tweak release name
This is consistent with prior releases.
2020-03-15 22:07:22 -04:00
b9cd95faf1 release: 12.0.0, take 2 12.0.0 2020-03-15 21:54:11 -04:00
92daa34eb3 ripgrep: release 12.0.0 grep-searcher-0.1.7 grep-regex-0.1.6 grep-printer-0.1.4 grep-pcre2-0.1.4 grep-matcher-0.1.4 ignore-0.4.12 grep-0.2.5 globset-0.4.5 grep-cli-0.1.4 2020-03-15 21:42:54 -04:00
a8c1fb7c88 changelog: prepare for 12.0.0 release 2020-03-15 21:06:45 -04:00
52ec68799c ci: make script names consistent 2020-03-15 21:06:45 -04:00
c0d78240df ci: remove Travis and appveyor specific stuff 2020-03-15 21:06:45 -04:00
cda9acb876 ci: rebuild release infrastructure on GitHub Actions 2020-03-15 21:06:45 -04:00
1ece50694e readme: update file size 2020-03-15 13:27:31 -04:00
f3a966bcbc readme: add 'Unicode' label to ugrep 2020-03-15 13:26:02 -04:00
a38913b63a readme: update benchmarks
This also updates the corpora used, so previous times (and counts) are
not comparable.

We also remove some tools, likt pt, sift and ucg, since they appear to
be no longer maintained. ag isn't really maintained either, but it still
has significant mind share, so we retain a benchmark for it.

We also upgrade ack to version 3, and remove the clarification on how
`-w` is implemented.

We also add `git grep -P` (uses PCRE2) which appears to be much faster
than `git grep -E`.

Finally, we add ugrep which is a new up and comer in this space.

Fixes #1474
2020-03-15 13:21:18 -04:00
e772a95b58 regex: avoid using literal optimizations when whitespace is detected
If a literal is entirely whitespace, then it's quite likely that it is
very common. So when that case occurs, just don't do (inner) literal
optimizations at all.

The regex engine may still make sub-optimal decisions here, but that's a
problem for another day.

Fixes #1087
2020-03-15 13:19:14 -04:00
9dd4bf8d7f style: fix rust-analyzer lint warnings 2020-03-15 13:19:14 -04:00
c4c43c733e cli: add --no-ignore-files flag
The purpose of this flag is to force ripgrep to ignore all --ignore-file
flags (whether they come before or after --no-ignore-files).

This flag can be overridden with --ignore-files.

Fixes #1466
2020-03-15 13:19:14 -04:00
447506ebe0 doc: clarify globing behavior
Fixes #1442, Fixes #1478
2020-03-15 13:19:14 -04:00
12e4180985 doc: remove CPU features from man pages
It doesn't really belong in the man page since it's an artifact of a
build/runtime configuration. Moreover, it inhibits reproducible builds.

Fixes #1441
2020-03-15 13:19:14 -04:00
daa8319398 doc: note ripgrep's stdin behavior
Fixes #1439
2020-03-15 13:19:14 -04:00
3a6a24a52a cli: add engine flag
This permits switching between the different regex engine modes that
ripgrep supports. The purpose of this flag is to make it easier to
extend ripgrep with additional regex engines.

Closes #1488, Closes #1502
2020-03-15 09:30:58 -04:00
aab3d80374 args: refactor to permit adding other engines
This is in preparation for adding a new --engine flag which is intended
to eventually supplant --auto-hybrid-regex.

While there are no immediate plans to add more regex engines to ripgrep,
this is intended to make it easier to maintain a patch to ripgrep with
an additional regex engine. See #1488 for more details.
2020-03-15 09:24:28 -04:00
1856cda77b style: fix rust-analyzer lints in core 2020-03-15 09:04:54 -04:00
7340d8dbbe deps: update everything
This adds one new dependency, maybe-uninit, which is brought in by
crossbeam-channel[1]. This is to apparently fix some unsound code
without bumping the MSRV. Since ripgrep uses the latest stable release
of Rust, the maybe-uninit crate should compile down to nothing and just
re-export std's `MaybeUninit` type.

[1] - https://github.com/crossbeam-rs/crossbeam/pull/458
2020-03-15 08:32:33 -04:00
50d2047ae2 crates: update URLs in Cargo.toml
This corrects an oversight when the repo was re-organized to
have its crates moved into a 'crates' sub-directory.

PR #1505
2020-02-28 20:31:43 -05:00
227436624f ignore/types: add coq type
PR #1504
2020-02-28 19:11:29 -05:00
5bfdd3a652 ci: fix ci by removing fetch-depth 1
It's not clear why removing this makes things work. I've submitted
PRs that passed CI with fetch-depth=1. Maybe it only fails when
PRs are submitted from external contributors?

Either way, for now, we remove this and absorb the extra cost in
order to get PRs passing CI again.

PR #1501
2020-02-27 08:53:06 -05:00
ecec6147d1 doc: be more vague in the FAQ
The existing vagueness was not enough to prevent people from lawyering
me over it.
2020-02-22 09:13:31 -05:00
db7a8cdcb5 globset: Implement serde::{Serialize, Deserialize} for Glob
PR #1492
2020-02-21 07:40:47 -05:00
eef7a7e7ff readme: update CI badge 2020-02-20 18:15:15 -05:00
4176050cdd ignore: another simplification
Again, thanks to @zsugabubus!
2020-02-20 17:26:34 -05:00
109460fce2 ignore: simplify parallel worker initialization
We can just ask the channel whether any work has been loaded. Normally
querying a channel for its length is a strong predictor of bugs, but in
this case, we do it before we ever attempt a `recv`, so it should work.

Kudos to @zsugabubus for suggesting this!
2020-02-20 16:50:41 -05:00
da3431b478 ci: switch build to GitHub Actions 2020-02-20 16:07:51 -05:00
f314b0d55f ignore: fix parallel traversal
It turns out that the previous version wasn't quite correct. Namely, it
was possible for the following sequence to occur:

1. Consider that all workers, except for one, are `waiting`.
2. The last remaining worker finds one more job to do and sends it on
   the channel.
3. One of the previously `waiting` workers wakes up from the job that
   the last running worker sent, but `self.resume()` has not been
   called yet.
4. The last worker, from (2), calls `get_work` and sees that the
   channel has nothing on it, so it executes `self.waiting() ==
   1`. Since the worker in (3) hasn't called `self.resume()` yet,
   `self.waiting() == 1` evaluates to true.
5. This sets off a chain reaction that stops all workers, despite that
   fact that (3) got more work (which could itself spawn more work).

The end result is that the traversal may terminate while their are still
outstanding work items to process. This problem was observed through
spurious failures in CI. I was not actually able to reproduce the bug
locally.

We fix this by changing our strategy to detect termination using a
counter. Namely, we increment the counter just before sending new work
and decrement the counter just after finishing work. In this way, we
guarantee that the counter only ever reaches 0 once there is no more
work to process.

See #1337 for more discussion. Many thanks to @zsugabubus for helping me
work through this.
2020-02-20 16:07:51 -05:00
fab5c812f3 tests: add debugging output
The transient failures appear to be persisting and they are quite
difficult to debug. So include a full directory listing in the output of
every test failure.
2020-02-20 16:07:51 -05:00
c824d095a7 tests: use std::env::consts::EXE_SUFFIX
This avoids a conditional compilation knob and is likely more portable.
2020-02-20 16:07:51 -05:00
ee21897ebd tests: make 'cross test' work
The reason why it wasn't working was the integration tests. Namely, the
integration tests attempted to execute the 'rg' binary directly from
inside cross's docker container. But this obviously doesn't work when
'rg' was compiled for a totally different architecture.

Cross normally does this by hooking into the Rust test infrastructure
and causing tests to run with 'qemu'. But our integration tests didn't
do that. This commit fixes our test setup to check for cross's
environment variable that points to the 'qemu' binary. Once we have
that, we just use 'qemu-foo rg' instead of 'rg'. Piece of cake.
2020-02-20 16:07:51 -05:00
0373f6ddb0 ci: soft-disable Travis and AppVeyor 2020-02-20 16:07:51 -05:00
b44554c803 ignore/types: add K type
Adds support for files used by the K executable semantic framework:
http://www.kframework.org/index.php/Main_Page

PR #1493
2020-02-19 07:07:09 -05:00