1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-01-08 13:23:34 +02:00
Commit Graph

1984 Commits

Author SHA1 Message Date
Andrew Gallant
d0251c77fe
grep-matcher-0.1.7 2023-11-26 14:13:54 -05:00
Andrew Gallant
6aa5993d4b
deps: bump grep-cli to 0.1.10 2023-11-26 14:13:40 -05:00
Andrew Gallant
6f78d211bf
grep-cli-0.1.10 2023-11-26 14:13:03 -05:00
Andrew Gallant
51aa339830
deps: bump ignore to 0.4.21 2023-11-26 14:12:55 -05:00
Andrew Gallant
381c521d02
ignore-0.4.21 2023-11-26 14:12:16 -05:00
Andrew Gallant
57495db10e
deps: bump globset to 0.4.14 2023-11-26 14:11:43 -05:00
Andrew Gallant
47e37175ca
globset-0.4.14 2023-11-26 14:11:05 -05:00
Andrew Gallant
8697946718
release/doc: set date in man page 2023-11-26 14:10:07 -05:00
Andrew Gallant
8058859701
changelog: add link for reporting perf improvements/regressions 2023-11-26 14:05:23 -05:00
Andrew Gallant
e9ff90c8ff
changelog: updates for the 14.0.0 release 2023-11-26 14:03:59 -05:00
Andrew Gallant
bf9f74ea5b
doc: progress 2023-11-26 13:32:39 -05:00
Andrew Gallant
9b5091b895
deps: bump to memmap2 0.9.0 2023-11-26 13:32:39 -05:00
Andrew Gallant
a4f165e3ab
deps: bump everything 2023-11-26 13:32:39 -05:00
Andrew Gallant
d1def67000
deps: bump pcre2 to 0.2.6 2023-11-26 13:32:20 -05:00
Andrew Gallant
56af4d4a74
cli: add simple flag suggestions
We look for similar flag names via Jaccard index on ngrams. In my
experience this tends to work better than Levenshtein or other edit
distance based metrics. Principally because it allows for out-of-order
suggestions. For example, --case-smart will result in a suggestion for
--smart-case, even though the edit distance between them is pretty big.

This is something Clap did for us. I initially thought it wasn't
necessary to add this back in, but I realized it wouldn't be much work
and might actually be helpful to folks.
2023-11-26 09:55:44 -05:00
Andrew Gallant
b0f6645408
ci: remove local deb build-and-publish script
I moved this to GitHub Actions. w00t.
2023-11-25 18:27:52 -05:00
Andrew Gallant
3dbe371fe4
ci: add Debian release build
Previously, we were running 'cargo deb' locally. But the release process
is a little simpler now thanks to GitHub Actions and the 'gh' tool, so I
felt comfortable putting the 'deb' generation in CI.

Now the only real manual part of release asset creation is the M2
release, but that should hopefully be automated once GitHub makes Apple
silicon runners available for free.
2023-11-25 18:20:05 -05:00
Andrew Gallant
30d06b3b4c changelog: note that --no-ignore --ignore-vcs works as expected
This fix fell out of the move off of Clap.

Closes #1376
2023-11-25 15:03:53 -05:00
Andrew Gallant
6a055d922c doc: clarify errors for -z/--search-zip
Fixes #1622
2023-11-25 15:03:53 -05:00
Andrew Gallant
e007523229 doc: note the precedence of -t/--type
Fixes #1635
2023-11-25 15:03:53 -05:00
Andrew Gallant
88353c80da doc: be more explicit about ripgrep's behavior when printing to a tty
Fixes #1709
2023-11-25 15:03:53 -05:00
Andrew Gallant
cd3bcce42d changelog: mention M2 binaries for releases
Fixes #1737
2023-11-25 15:03:53 -05:00
Andrew Gallant
1ea3552f2d changelog: mention perf improvement for inner literals
Fixes #1746
2023-11-25 15:03:53 -05:00
Andrew Gallant
9ed7565fcb cli: error when searching for NUL
Basically, unless the -a/--text flag is given, it is generally always an
error to search for an explicit NUL byte because the binary detection
will prevent it from matching.

Fixes #1838
2023-11-25 15:03:53 -05:00
Andrew Gallant
7bb9f35d2d doc: clarify that --pre can accept any kind of path
Fixes #2046
2023-11-25 15:03:53 -05:00
Andrew Gallant
b138d5740a log: add message about number of threads used
Closes #2122
2023-11-25 15:03:53 -05:00
Andrew Gallant
3f0c8c2900 doc: improve -r/--replace docs
It looks like this was done a while ago, but it didn't get added to the
CHANGELOG or connected with the corresponding issue.

Fixes #2201
2023-11-25 15:03:53 -05:00
Andrew Gallant
0e6e9417f1 log: add message when a binary file is skipped
The way we do this is a little hokey but I believe it is correct.

Fixes #2246
2023-11-25 15:03:53 -05:00
Andrew Gallant
fded2a5fe1 doc: add cargo-binstall instructions
Closes #2298
2023-11-25 15:03:53 -05:00
Andrew Gallant
e14eeb288f doc: mention that --stats is always implied by --json
Fixes #2337
2023-11-25 15:03:53 -05:00
Andrew Gallant
1cbcefddc9 doc: add more warnings about --vimgrep
The --vimgrep flag has some severe footguns when using a pattern that
matches very frequently. We had already written some docs to warn about
that, but now we also include a suggestion to avoid exorbitant heap
usage.

Closes #2505
2023-11-25 15:03:53 -05:00
Andrew Gallant
4fec9ffca8 doc: make the opening line a bit more descriptive
This mimics what was written in the man page.

Closes #2401
2023-11-25 15:03:53 -05:00
Andrew Gallant
00225a035b doc: improve --sort=path
This clarifies that the paths are not sorted in a fully lexicographic
order, but that / is treated specially.

Fixes #2418
2023-11-25 15:03:53 -05:00
Andrew Gallant
286de9564e cli: rejigger --version to include PCRE2 info
This adds info about whether PCRE2 is available or not to the output of
--version. Essentially, --version now subsumes --pcre2-version, although
we do retain the former because it (usefully) emits an exit code based
on whether PCRE2 is available or not.

Closes #2645
2023-11-25 15:03:53 -05:00
Andrew Gallant
038524a580 printer: trim before applying max column windowing
Previously, we were applying the -M/--max-columns flag *before* triming
prefix ASCII whitespace. But this doesn't make a whole lot of sense. We
should be trimming first, but the result of trimming is ultimately what
we'll be printing and that's what -M/--max-columns should be applied to.

Fixes #2458
2023-11-25 15:03:53 -05:00
Andrew Gallant
8f9557d183 changelog: mention shell completion generation feature
Closes #2425
2023-11-25 15:03:53 -05:00
Andrew Gallant
58e7d2ea63 doc: add docs about .ignore/.rgignore in parent directories
Closes #2479
2023-11-25 15:03:53 -05:00
Andrew Gallant
b7df9f8caa changelog: mention --field-match-separator bug fix
This was probably fixed in the migration off of Clap.

Closes #2519
2023-11-25 15:03:53 -05:00
Andrew Gallant
ebb986e767 logging: show heuristic information and decision
When one does not provide any paths to ripgrep to search, it has to
guess between searching stdin and the current working directory. It is
possible for this guess to be wrong, and having the heuristics and the
choice in the debug logs is useful for diagnosing this.

The failure mode here is still pretty bad because you need to know to
reach for the `--debug` flag in the first place. Namely, the typical
failure mode is that ripgrep tries to search stdin while the intent is
for it to search the current working directory, and thus likely blocking
forever waiting for data on stdin.

(Arguably this is a problem with the process architecture that invokes
ripgrep. It shouldn't give ripgrep an open stdin handle that isn't
closed.)

Closes #2524
2023-11-25 15:03:53 -05:00
Andrew Gallant
a2907db2de
faq: update donation section to mention sponsorships 2023-11-21 19:05:58 -05:00
Andrew Gallant
470ad1d072
faq: rewrite the section on shell completions 2023-11-21 19:02:07 -05:00
Tavian Barnes
6d7550d58e ignore: Avoid contention on num_pending
Previously, every worker would increment the shared num_pending count on
every new work item, and decrement it after finishing them, leading to
lots of contention.  Now, we only track the number of workers actively
running, so there is no contention except when workers go to sleep or
wake up.

Closes #2642
2023-11-21 18:39:32 -05:00
Andrew Gallant
af55fc2b38 cli: make -d a short flag for --max-depth
Interestingly, ripgrep now only has two available ASCII letter short
flags remaining: -k and -y.

Closes #2643, Closes #2644
2023-11-21 18:39:32 -05:00
Andrew Gallant
3d2f49f6fe changelog: --pretty now behaves more sensibly
This actually just kind of fell out of the migration off of Clap as a
result of treating `-p/--pretty` more rigorously as an alias for
`--line-number --heading --color always`.

Fixes #2381, Closes #2637
2023-11-21 18:39:32 -05:00
Andrew Gallant
50b2472438 ci: strip release binaries on macOS
We were purportedly doing this already, but actually weren't because of
confusion in the `if` condition.

Closes #2636
2023-11-21 18:39:32 -05:00
Andrew Gallant
ae2a09915f printer: drop dependency on base64 crate
Instead, we just roll our own. A slow version of this is pretty simple
to do, and that's what we write here. The `base64` crate supports a lot
more functionality and is quite fast, but we care about neither of those
things for this particular aspect of ripgrep. (base64 is only used for
non-UTF-8 data or file paths, which are both quite rare.)
2023-11-21 18:39:32 -05:00
Andrew Gallant
9c84575229 printer: drop dependency on serde_derive
As suggested by @epage[1].

Ad hoc timings on my i7-12900K:

    before cargo build: 4.91s
    before cargo build release: 8.05s
    after cargo build: 4.69s
    after cargo build release: 7.83s

... pretty underwhelming if you ask me. Ah well. And on my M2 mac mini:

    before cargo build: 6.18s
    before cargo build release: 14.50s
    after cargo build: 5.52s
    after cargo build release: 13.44s

Still kind of underwhelming, but definitely better. It shaves a full
second off of compile times in release mode. I went back to my
i7-12900K, but passed `-j1` to `cargo build` to force single threaded
mode:

    before cargo build: 19.44s
    before cargo build release: 50.64s
    after cargo build: 16.76s
    after cargo build release: 48.00s

Which seems pretty consistent with the modest improvements above.

Looking at `cargo build --timings`, the beefiest chunk of time is spent
in compiling `regex-automata`, by far. This is fine because it's core
functionality. I wish a fast general purpose regex engine with its
internals exposed as a separately versioned library didn't require so
much code... Blech.

[1]: https://old.reddit.com/r/rust/comments/17rd8ww/faster_compilation_with_the_parallel_frontend_in/k8igjlg/
2023-11-21 18:39:32 -05:00
Andrew Gallant
cddb5f57f8 printer: rejigger how we use serde_derive
The idea is that by bringing derives in via serde's optional feature, it
was inhibiting compilation speed[1]. We try to fix that by depending on
`serde_derive` as a distinct dependency.

It does seem to improve overall compilation time, but only by about 0.5
seconds. With that said, my machine has a lot of cores, so it's possible
this will help more on less powerful CPUs.

[1]: https://old.reddit.com/r/rust/comments/17rd8ww/faster_compilation_with_the_parallel_frontend_in/k8igjlg/
2023-11-21 18:39:32 -05:00
Andrew Gallant
5dc424d302 doc: scrub mentions of asciidoc/asciidoctor
This optional dependency is now finally dropped. So ends a long journey
of trying to generate man pages in a lightweight and dependable way. The
only thing I could figure out how to make work reliably was to just
learn how to write roff myself. Yay.
2023-11-21 18:39:32 -05:00
Andrew Gallant
040d8f2171 ci: improve docs for manual build-and-publish scripts 2023-11-21 18:39:32 -05:00