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

1615 Commits

Author SHA1 Message Date
478da4f271 pkg: fix version number for 13.0.0 release
Fixes #1896
2021-06-15 10:30:01 -04:00
7ce66f73cf regex: update regression test
Sadly, PCRE2 has different behavior (but doesn't panic). We should look
into that, but for now, this is good enough.

Also, update the CHANGELOG.

Ref #1891
2021-06-12 16:22:30 -04:00
bc76a30c23 regex: fix -w when regex can match empty string
This is a weird bug where our optimization for handling -w more quickly
than we would otherwise failed. In particular, if the original regex can
match the empty string, then our word boundary detection would produce
invalid indices to the start the next search at. We "fix" it by simply
bailing when the indices are known to be incorrect.

This wasn't a problem in a previous release since ripgrep 13 tweaked how
word boundaries are detected in commit efd9cfb2.

Fixes #1891
2021-06-12 14:18:53 -04:00
5e81c60b35 ci: use musl to build debian artifact
Previously, I was trying to be a good citizen and let ripgrep use the
system libc. But it turns out that building ripgrep on Arch with a newer
version of glibc than what is in Ubuntu results in the whole thing
breaking. Arguably, I should build the Debian artifact on an Ubuntu or
Debian machine of an appropriate version, but that's too much work. If
people really want that, then they can install some ancient version of
ripgrep from their Ubuntu/Debian repo.

Since we were already statically linking PCRE2, we go the whole nine
yards and statically link the entire thing.

Fixes #1890
2021-06-12 13:36:57 -04:00
b3e5ae9d28 changelog: add template for next entry 2021-06-12 08:43:49 -04:00
a024f14fdd pkg: update brew tap version to 13.0.0 2021-06-12 08:43:30 -04:00
8c30c8294a release: work around GitHub Actions weirdness 2021-06-12 08:40:48 -04:00
c44d263419 release: add note about pushing changes 2021-06-12 08:13:29 -04:00
af6b6c543b 13.0.0 13.0.0 2021-06-12 08:12:24 -04:00
1a4fec8b4a changelog: final prep before ripgrep 13 release 2021-06-12 08:11:51 -04:00
c8d8ab8ded deps/grep: update minimal versions 2021-06-12 08:08:58 -04:00
1d53ed2744 grep-0.2.8 grep-0.2.8 2021-06-12 08:08:32 -04:00
29696d1455 deps/printer: update minimal versions 2021-06-12 08:08:18 -04:00
57ce623a57 grep-printer-0.1.6 grep-printer-0.1.6 2021-06-12 08:07:46 -04:00
f1c656de40 deps/searcher: update minimal versions 2021-06-12 08:07:28 -04:00
dd47582619 grep-searcher-0.1.8 grep-searcher-0.1.8 2021-06-12 08:06:58 -04:00
9b88cf8b72 deps/pcre2: update minimal versions 2021-06-12 08:06:50 -04:00
6668d7ba8a grep-pcre2-0.1.5 grep-pcre2-0.1.5 2021-06-12 08:06:29 -04:00
008da5dca4 pcre2: update minimal version to 0.2.3 2021-06-12 08:05:56 -04:00
a34df1f690 deps/regex: update minimal versions 2021-06-12 08:05:36 -04:00
7f3fd6f7ce grep-regex-0.1.9 grep-regex-0.1.9 2021-06-12 08:03:56 -04:00
6331a7ac18 deps/matcher: update minimal versions 2021-06-12 08:03:47 -04:00
cd4386bd9b grep-matcher-0.1.5 grep-matcher-0.1.5 2021-06-12 08:02:30 -04:00
cdc20c5685 deps/cli: update minimal versions 2021-06-12 08:02:18 -04:00
0cf2b98df2 grep-cli-0.1.6 grep-cli-0.1.6 2021-06-12 08:01:22 -04:00
9efdbf74a1 deps/ignore: update minimal versions 2021-06-12 08:01:13 -04:00
53cb9a779e release: add step about making sure 'master' is in sync
Otherwise, if we start doing crate releases from the local checkout
(with git tags) and it turns out that origin/master has newer commits,
rebasing local master will then invalidate those tags.
2021-06-12 07:59:47 -04:00
14860b0f16 ignore-0.4.18 ignore-0.4.18 2021-06-12 07:59:07 -04:00
0eb1a1e7c9 deps/globset: update minimal versions 2021-06-12 07:58:46 -04:00
5631e5c7a0 globset-0.4.7 globset-0.4.7 2021-06-12 07:56:56 -04:00
21644408f2 release: tweak 'cargo outdated' advice
I do run --aggressive, although I've been ignoring the clap 3 update for
what seems like forever since it's still in beta.
2021-06-12 07:54:51 -04:00
0ee85a89f5 deps: update to memmap2
Looking at the changelog for memmap2, the only breaking change was to
MmapOptions, which we don't use. So no migration is needed.
2021-06-12 07:53:42 -04:00
ed9d37959f deps: updates libc and syn 2021-06-12 07:52:04 -04:00
9f924ee187 msrv: bump to Rust 1.52.1
This matches the latest stable release of Rust.
2021-06-01 21:07:37 -04:00
35c5db6d1a deps: update everything
Removes two dependencies! autocfg and byteorder.
2021-06-01 21:07:37 -04:00
e824531e38 edition: manual changes
This is mostly just about removing 'extern crate' everywhere and fixing
the fallout.
2021-06-01 21:07:37 -04:00
af54069c51 edition: run 'cargo fix --edition --edition-idioms --all' 2021-06-01 21:07:37 -04:00
77a9e99964 edition: set edition=2018 2021-06-01 21:07:37 -04:00
459a9c5637 edition: initial 'cargo fix --edition' run 2021-06-01 21:07:37 -04:00
e4c4540f6a changelog: fix typo and add Ruby to type improvement list 2021-06-01 11:57:16 -04:00
5d0f2b0fc0 ignore/types: config.ru and *.rbw Ruby
PR #1886
2021-06-01 10:57:09 -04:00
079a23b515 changelog: a bit of polish
I think I'm just waiting on the CVE to be published at this point.
2021-06-01 06:59:06 -04:00
6e27649af1 github: add note about file types 2021-06-01 06:26:13 -04:00
df83b8b444 ci: re-work github actions release
This combines the tips from #1820 and the patch submitted in #1675.
The latter wasn't taken as-is because I didn't agree with some of the
changes, and in particular, it removed the ability to easily test the
release on a branch with a dummy tag name. I've tried to add that back
here with the 'rg_version' output. Overall though, using outputs is
indeed much simpler.

Closes #1675, Closes #1820
2021-05-31 21:51:18 -04:00
e48a17e189 changelog: prep for ripgrep 13 release 2021-05-31 21:51:18 -04:00
fbb2cfed28 printer: trim line terminator before doing replacements
This is basically the same bug as #1401, but applied to replacements
instead of --only-matching.

Fixes #1739
2021-05-31 21:51:18 -04:00
af8b27ffae changelog: fish completions are staying
In a previous release, I announced that Fish completions were being
removed. But the Fish project decided to remove theirs and have
ripgrep's stay.

Closes #1577
2021-05-31 21:51:18 -04:00
8a4071eea9 globset: expand docs and impl Default for GlobSet
Closes #1882, Closes #1883
2021-05-31 21:51:18 -04:00
ee23ab5173 printer: trim line terminator before finding submatches
This fixes a bug where PCRE2 look-around could change the result of a
match if it observed a line terminator in the printer. And in
particular, this is precisely how the searcher operates: the line is
considered unto itself *without* the line terminator.

Fixes #1401
2021-05-31 21:51:18 -04:00
efd9cfb2fc grep: fix bugs in handling multi-line look-around
This commit hacks in a bug fix for handling look-around across multiple
lines. The main problem is that by the time the matching lines are sent
to the printer, the surrounding context---which some look-behind or
look-ahead might have matched---could have been dropped if it wasn't
part of the set of matching lines. Therefore, when the printer re-runs
the regex engine in some cases (to do replacements, color matches, etc
etc), it won't be guaranteed to see the same matches that the searcher
found.

Overall, this is a giant clusterfuck and suggests that the way I divided
the abstraction boundary between the printer and the searcher is just
wrong. It's likely that the searcher needs to handle more of the work of
matching and pass that info on to the printer. The tricky part is that
this additional work isn't always needed. Ultimately, this means a
serious re-design of the interface between searching and printing. Sigh.

The way this fix works is to smuggle the underlying buffer used by the
searcher through into the printer. Since these bugs only impact
multi-line search (otherwise, searches are only limited to matches
across a single line), and since multi-line search always requires
having the entire file contents in a single contiguous slice (memory
mapped or on the heap), it follows that the buffer we pass through when
we need it is, in fact, the entire haystack. So this commit refactors
the printer's regex searching to use that buffer instead of the intended
bundle of bytes containing just the relevant matching portions of that
same buffer.

There is one last little hiccup: PCRE2 doesn't seem to have a way to
specify an ending position for a search. So when we re-run the search to
find matches, we can't say, "but don't search past here." Since the
buffer is likely to contain the entire file, we really cannot do
anything here other than specify a fixed upper bound on the number of
bytes to search. So if look-ahead goes more than N bytes beyond the
match, this code will break by simply being unable to find the match. In
practice, this is probably pretty rare. I believe that if we did a
better fix for this bug by fixing the interfaces, then we'd probably try
to have PCRE2 find the pertinent matches up front so that it never needs
to re-discover them.

Fixes #1412
2021-05-31 21:51:18 -04:00