1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
Commit Graph

1580 Commits

Author SHA1 Message Date
Andrew Gallant
b1e3de246c
changelog: add empty TBD section to CHANGELOG
And update the release checklist to mention this process.
2020-05-29 09:49:45 -04:00
Andrew Gallant
bb36fc1bf8
pkg: update brew tap version to 12.1.1 2020-05-29 09:48:19 -04:00
Andrew Gallant
7cb211378a
12.1.1 2020-05-29 09:26:47 -04:00
Andrew Gallant
a73c0a21d9
changelog: 12.1.1 2020-05-29 09:26:33 -04:00
Andrew Gallant
0b965f900c
doc: small release checklist updates
In particular, explicitly note when to update the CHANGELOG.

Also, tweak the ripgrep introductory message.
2020-05-29 09:21:19 -04:00
Andrew Gallant
a2f90747c9
core: update minimal dependency versions 2020-05-29 09:18:59 -04:00
Andrew Gallant
f97cc623f7
grep-0.2.7 2020-05-29 09:17:24 -04:00
Andrew Gallant
f35de5c523
grep: update minimal dependency versions 2020-05-29 09:17:08 -04:00
Andrew Gallant
c9bb78ceba
grep-cli-0.1.5 2020-05-29 09:14:18 -04:00
Andrew Gallant
72bdde6771
ignore-0.4.16 2020-05-29 09:13:02 -04:00
Andrew Gallant
d66712a452
deps: update all dependencies 2020-05-29 09:11:50 -04:00
Andy Salerno
e8822ce97a
ignore/doc: update misleading documentation
This likely originated from a bad copy/paste.

PR #1596
2020-05-24 23:12:53 -04:00
Andrew Gallant
a700b75843
doc: clarify capture group indices
And in particular, note the special $0 index, which corresponds to the
entire match.

Fixes #1591
2020-05-21 22:22:51 -04:00
Gerion Entrup
b72ad8f8aa
ignore/types: add meson filetype
Closes #1586, PR #1587
2020-05-18 14:01:35 -04:00
Andrew Gallant
1980630f17
doc: fix egregious markup output
We use '+++' syntax to output a literal '**' for a '--glob' example.
This '+++' syntax is pretty ugly when rendered literally via --help. We
fix this by hackily inserting the '+++' syntax for its one specific case
that we need it during man page generation.

Not ideal but it works. And --help still has some '*foo*' markup, but we
live with that for now.

Fixes #1581
2020-05-13 08:13:05 -04:00
Andrew Gallant
1e9a481a66
doc: more release checklist updates 2020-05-09 11:43:37 -04:00
Andrew Gallant
bacfca174e
pkg: update brew tap to version 12.1.0
This also removes Fish shell completions. See #1577 for more details.
2020-05-09 11:42:39 -04:00
Andrew Gallant
6162b000a3
changelog: 12.1.0 2020-05-09 11:36:44 -04:00
Andrew Gallant
2658bd4e46
12.1.0 2020-05-09 11:13:33 -04:00
Andrew Gallant
4b8e1f030e
doc: add more detail to release checklist
Getting the crate order right is important, so document it.
2020-05-09 11:12:51 -04:00
Andrew Gallant
72807462e8
deps: update minimal versions for dependencies 2020-05-09 10:39:43 -04:00
Andrew Gallant
08dee094dd
grep-0.2.6 2020-05-09 10:37:29 -04:00
Andrew Gallant
caa53b7b09
grep: update minimal dependency versions 2020-05-09 10:37:08 -04:00
Andrew Gallant
c5d6141562
grep-printer-0.1.5 2020-05-09 10:33:02 -04:00
Andrew Gallant
c0f0492b98
grep-regex-0.1.8 2020-05-09 10:31:29 -04:00
Andrew Gallant
568018386b
ignore-0.4.15 2020-05-09 10:27:19 -04:00
Andrew Gallant
6219d29c24
doc: add 'cargo outdated' step to release checklist
It's just good sense to make sure everything is updated if possible.
2020-05-09 10:26:00 -04:00
Andrew Gallant
b458cf39f2
deps: update to base64 0.12
No code changes were necessary.
2020-05-09 10:25:37 -04:00
Andrew Gallant
3fd2694fbc
deps: update all dependencies
Everything looks pretty minor.
2020-05-09 09:05:51 -04:00
Andrew Gallant
b56315ea84
changelog: add #1550 to CHANGELOG 2020-05-08 23:37:17 -04:00
Andrew Gallant
fac47906e6 doc: add a release checklist
The steps are numerous, subtle and complex enough that it's worth
writing them down. In particular, getting the order correct is
important. (i.e., If we released to crates.io first and the GitHub
release infrastructure failed, then we'd be in a pickle.)
2020-05-08 23:24:40 -04:00
Andrew Gallant
e02bb6b99a changelog: add downstream notices 2020-05-08 23:24:40 -04:00
Chayoung You
16a1221fc7 doc: use asciidoctor instead of a2x
AsciiDoc development is continued under asciidoctor. See
https://github.com/asciidoc/asciidoc.

We do however fallback to a2x if asciidoctor is not present. This is to
ease migration, but at some point, it's likely that support for a2x will
be dropped.

Originally reported downstream:
https://github.com/Homebrew/linuxbrew-core/issues/19885

Closes #1544
2020-05-08 23:24:40 -04:00
Casey Rodarmor
793c1179cc ignore: allow filtering with predicate
Adds `WalkBuilder::filter_entry` that takes a predicate to be applied to
all entries. If the predicate returns `false` on a given entry, that
entry and all children will be skipped.

Fixes #1555, Closes #1557
2020-05-08 23:24:40 -04:00
Wieland Hoffmann
df7a3bfc7f grep-cli: support files compressed by compress(1)
While Linux distributions (at least Arch Linux, RHEL, Debian) do not support
compressing files with compress(1), macOS & AIX do (the utility is part of
POSIX). Additionally, gzip is able to uncompress such compressed files and
provides an `uncompress` binary.

Closes #1547
2020-05-08 23:24:40 -04:00
Andrew Gallant
28f2a93cae doc: shorten -h/--help prelude
It has grown quite long. It would be nice if we could shorten this only
when -h is used and keep it long for --help, but it seems clap doesn't
let this happen. (It does have `about` and `long_about` options, but
they don't work, even when I disable the use of the template.)

The longer prelude is now only available in the man page.

This addresses #189.
2020-05-08 23:24:40 -04:00
Andrew Gallant
0eb2501b6e doc: add a section about --pre to the GUIDE
Fixes #1252
2020-05-08 23:24:40 -04:00
Andrew Gallant
184c15882e doc: add -U/--multiline to common options 2020-05-08 23:24:40 -04:00
Andrew Gallant
64a4dee495 cli: improve invalid UTF-8 pattern error message
When a pattern with invalid UTF-8 is given, the error message suggests
unqualified use of hex escape sequences to match arbitrary bytes. But
you *also* need to disable Unicode mode. So include that in the error
message.

Fixes #1339
2020-05-08 23:24:40 -04:00
Andrew Gallant
50840ea43b doc: note how to escape a '$' in --replace
Fixes #1524
2020-05-08 23:24:40 -04:00
Andrew Gallant
17dcc2bf51 doc: clarify that *files* override gitignores
This attempts to fix some mild confusion that came up as part of #1574.
Specifically:
https://github.com/BurntSushi/ripgrep/issues/1574#issuecomment-625780436
2020-05-08 23:24:40 -04:00
Andrew Gallant
9a858e4909 doc: add config file note for --type-{add,clear}
This clarifies that persistence is possible via a configuration file.

Fixes #1571
2020-05-08 23:24:40 -04:00
Andrew Gallant
cbfbe9312f snap: remove snapcraft configuration
This hasn't been updated in ages and it's not clear what purpose it's
serving.
2020-05-08 23:24:40 -04:00
Andrew Gallant
7ed9a31819 printer: fix --count-matches output
In order to implement --count-matches, we simply re-execute the regex on
the spans reported by the searcher. The spans always correspond to the
lines that participated in the match. This is the correct thing to do,
except when the regex contains look-ahead (or look-behind).

In particular, the look-around permits the regex's match success to
depends on an arbitrary point before or after the lines actually
reported as participating in the match. Since only the matched lines are
reported to the printer, it is possible for subsequent searching on
those lines to fail.

A true fix for this would somehow make the total span available to the
printer. But that seems tricky since it isn't always available. For
PCRE2's case in multiline mode, it is available because we force it to
be so for correctness.

For now, we simply detect this corner case heuristically. If the match
count is zero, then it necessarily means there is some kind of
look-around that isn't matching. So we set the match count to 1. This is
probably incorrect in some cases, although my brain can't quite come up
with a concrete example. Nevertheless, this is strictly better than the
status quo.

Fixes #1573
2020-05-08 23:24:40 -04:00
Andrew Gallant
a2e6aec7a4
tests: add new regression test for fixed inner literal bug
This adds a new test case for a bug (#1537) that has already been fixed.
Or more precisely, a new bug with the same root cause.

Closes #1559
2020-04-23 08:37:04 -04:00
Andrew Gallant
73103df6d9
deps: small dependency updates 2020-04-18 11:33:27 -04:00
Andrew Gallant
139f186e57 crates/ignore: switch to depth first traversal
This replaces the use of channels in the parallel directory traversal
with a simple stack. The primary motivation for this change is to reduce
peak memory usage. In particular, when using a channel (which is a
queue), we wind up visiting files in a breadth first fashion. Using a
stack switches us to a depth first traversal. While there are no real
intrinsic differences, depth first traversal generally tends to use less
memory because directory trees are more commonly wide than they are
deep.

In particular, the queue/stack size itself is not the only concern. In
one recent case documented in #1550, a user wanted to search all Rust
crates. The directory structure was shallow but extremely wide, with a
single directory containing all crates. This in turn results is in
descending into each of those directories and building a gitignore
matcher for each (since most crates have `.gitignore` files) before ever
searching a single file. This means that ripgrep has all such matchers
in memory simultaneously, which winds up using quite a bit of memory.

In a depth first traversal, peak memory usage is much lower because
gitignore matches are built and discarded more quickly. In the case of
searching all crates, the peak memory usage decrease is dramatic. On my
system, it shrinks by an order magnitude, from almost 1GB to 50MB. The
decline in peak memory usage is consistent across other use cases as
well, but is typically more modest. For example, searching the Linux
repo has a 50% decrease in peak memory usage and searching the Chromium
repo has a 25% decrease in peak memory usage.

Search times generally remain unchanged, although some ad hoc benchmarks
that I typically run have gotten a bit slower. As far as I can tell,
this appears to be result of scheduling changes. Namely, the depth first
traversal seems to result in searching some very large files towards the
end of the search, which reduces the effectiveness of parallelism and
makes the overall search take longer. This seems to suggest that a stack
isn't optimal. It would instead perhaps be better to prioritize
searching larger files first, but it's not quite clear how to do this
without introducing more overhead (getting the file size for each file
requires a stat call).

Fixes #1550
2020-04-18 11:33:03 -04:00
Andrew Gallant
afb325f733
readme: fix ordering of benchmarks
Results remain the same. I just didn't order them correctly.
2020-04-16 12:03:46 -04:00
Andrew Gallant
40af352d74
github: add necessary metadata 2020-04-14 16:28:09 -04:00
Andrew Gallant
3f1d4b397d
github: switch to new issue template format
And also point folks toward Discussions.
2020-04-14 16:23:47 -04:00