Commit Graph

612 Commits

Author SHA1 Message Date
Thayne McCombs d44badc190 Implement option for printing custom formats 2024-05-07 22:52:49 -06:00
Thayne McCombs b1f83a0bb0 feat: Add option to always include cwd prefix
Fixes: #1243
Fixes: #1331
2024-05-07 00:24:06 -06:00
Thayne McCombs a0ee0856db Add @timestamp to --help 2024-05-05 23:52:50 -06:00
Thayne McCombs 6647085015 Add test for gitignore workaround
And make sure it works for user-supplied path of "."

Also add changelog entry
2024-04-30 15:56:12 +02:00
Thayne McCombs 6af8f092ee Workaround for bug with gitinored files
This is a workaround for
https://github.com/BurntSushi/ripgrep/issues/2711

Fixes: #1461
2024-04-30 15:56:12 +02:00
Thayne McCombs e10a4eab2b Stop ignore .git folders by default
Fixes: #1457
See: #1396, #1403
2024-04-28 20:23:25 -06:00
Tavian Barnes 1031325cca filesystem: Remove a redundant as_str() 2024-04-28 17:30:44 -04:00
Tavian Barnes 9fc2167cf9
Merge pull request #1505 from leuven65/master
set default path separator to '/' in UCRT64 of MSYS
2024-04-28 17:23:43 -04:00
Thayne McCombs 7e5d14b733 Fix deprecation warning. 2024-04-27 21:58:54 -06:00
Thayne McCombs 85cbea8dcb
Merge pull request #1494 from nabellows/master
Add support for @%s time format
2024-04-26 22:37:54 -06:00
binlingyu 7794c4aae5 Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()' 2024-04-15 10:36:10 +08:00
Jian Wang f875ea9a52 Set default path separator to '/' in MSYS/MSYS2
The environments of MSYS: [[https://www.msys2.org/docs/environments/]]
2024-03-13 19:32:13 +01:00
one230six 138919907b refactor: Optimize code based on cargo clippy suggestions
Signed-off-by: one230six <723682061@qq.com>
2024-03-13 15:37:24 +08:00
garlic-hub 0788c43c3f
Clean up clippy warnings 2024-03-08 10:46:24 -08:00
Nathan Bellows ffde94c10e Run formatting 2024-02-12 02:12:58 -08:00
Nathan Bellows b0a8848f68 Add support for @%s time format 2024-02-12 02:05:41 -08:00
Alexandru-Constantin Atomei 3cb6b9d93a Updated CHANGELOG.md, man page and made alias visible in fd -h too 2024-01-01 17:14:32 +02:00
Atomei Alexandru c591106b86
Merge branch 'master' into dir_alias 2023-12-30 22:58:10 +02:00
Alexandru-Constantin Atomei 9f096737db Added explicit documentation about the possibility of using dir 2023-12-30 22:54:57 +02:00
Alexandru-Constantin Atomei 1bda165b25 Added alias --type dir 2023-12-30 22:14:53 +02:00
Thayne McCombs 9529f30129 fix: Respect NO_COLOR with --list-details option
Fixes: #1455
2023-12-23 21:32:33 +01:00
Tavian Barnes 16c2d1e1d0 walk: Flush stdout in batches
The previous behaviour was designed to mimic the output buffering of
typical UNIX tools: line-buffered if stdout is a TTY, and fully-buffered
otherwise.  More precicely, when printing to a terminal, fd would flush
explicitly after printing any buffered results, then flush after every
single result once streaming mode started.  When not printing to a
terminal, fd never explicitly flushed, so writes would only happen as
the BufWriter filled up.

The new behaviour actually unifies the TTY and non-TTY cases: we flush
after printing the buffered results, then once we start streaming, we
flush after each batch, but *only when the channel is empty*.  This
provides a good balance: if the channel is empty, the receiver thread
might as well flush before it goes to sleep waiting for more results.
If the channel is non-empty, we might as well process those results
before deciding to flush.

For TTYs, this should improve performance by consolidating write() calls
without sacrificing interactivity.  For non-TTYs, we'll be flushing more
often, but only when the receiver would otherwise have nothing to do,
thus improving interactivity without sacrificing performance.  This is
particularly handy when fd is piped into another command (such as head
or grep): with the old behaviour, fd could wait for the whole traversal
to finish before printing anything.  With the new behaviour, fd will
print those results soon after they are received.

Fixes #1313.
2023-12-18 22:01:11 +01:00
Tavian Barnes fea1622724 cli: Tweak default thread count logic 2023-12-18 21:55:18 +01:00
Tavian Barnes b8a5f95cf2 walk: Limit batch sizes in --exec mode 2023-11-28 15:51:33 -05:00
Tavian Barnes 73260c0e35 walk: Send WorkerResults in batches 2023-11-28 15:51:33 -05:00
Lena ad5fb44ddc
fix: display color when NO_COLOR is an empty string 2023-11-04 15:07:10 +01:00
Tavian Barnes 8bbbd7679b walk: New WorkerState struct shared by the worker threads 2023-11-02 17:07:38 +01:00
Thayne McCombs 5ee6365510 Set maximum default threads
Set a limit of how many threads fd will use by default. On hosts that
have a large number of cores, using additional threads has diminishing
returns, and having large numbers of threads increases the setup cost.
Thus we don't necessarily want to use the same number of threads as we
have cores.

Fixes: #1203
2023-10-26 00:48:30 -06:00
Thayne McCombs 1d57b3a064 Simplify parsing number of threads. 2023-10-25 23:56:59 -06:00
Thayne McCombs 325d419e39 Replace num_cpus with std:🧵:available_parallelism
I think this might help startup time a little bit, since it looks like
on linux at least the std implementation uses syscalls to determine the
parallelism, whereas num_cpus was processing the /proc/cpuinfo file.

It also removes another dependency.
2023-10-25 02:00:31 -06:00
João Marcos P. Bezerra 7263b5e01d Fix docs typos 2023-10-24 00:40:12 -03:00
Thayne McCombs c6fcdbe000 docs: Explicitly warn against relying on result order for exec
Supersedes: #1230
Fixes: #1228
2023-10-23 08:34:15 +02:00
Thayne McCombs 08910e4e3f docs: Some tweaks from review 2023-10-23 08:34:03 +02:00
Thayne McCombs 53fd416c47 docs: Document exclusion of .git/ 2023-10-23 08:34:03 +02:00
Thayne McCombs 054bae01ef maint: Remove use of unmaintained users crate
The users crate is no longer maintained. There is a maintained fork
called uzers, but we already have a dependency on nix, and that has the
functionality we need.
2023-10-21 23:37:32 -06:00
David Peter 0fc8facfb7 Fix --help text 2023-10-21 22:16:15 +02:00
Thayne McCombs 069b181625 Fix documentation for brace escapes 2023-10-21 22:16:15 +02:00
Thayne McCombs d9b69c8405 feat: Add a way to escape { and }in exec templates.
fixes #1303
2023-10-21 22:16:15 +02:00
Thayne McCombs a11f8426d4 Fix deprecation warning from chrono
Also change logic to use the latest time if the local time is ambiguous
(for example due to daylight savings)
2023-10-21 14:07:50 +02:00
Christian Göttsche 36bc84041b Support character and block device file types 2023-10-21 13:56:33 +02:00
Thayne McCombs 3ed4ea7538
Merge pull request #1396 from skoriop/default-ignore-git-folder
feat: ignore `.git/` by default
2023-10-20 22:35:22 -06:00
Karthik Prakash 9df9a489f0 refactor: replace `map_err` with `expect`
Co-authored-by: Thayne McCombs <astrothayne@gmail.com>
2023-10-18 13:06:51 +05:30
Thayne McCombs e6b5a4ef9d bug: Update clap to 4.4.6
This also fixes a couple of problems that are now errors:

- Remove use of unstable-grouped feature flag that no longer exists
- Fix some conflicts rules with non-existant options
  * has_results should have been quiet
  * count doesn't exist. I'm not sure where it came from

Fixes: #1397
2023-10-17 23:12:03 -06:00
skoriop 3f9794cd1a feat: ignore `.git/` by default 2023-10-15 11:11:53 +05:30
Eden Mikitas dea9110b90 Making `-1` conflict with `--exec` and making `max-results` override `-1` 2023-10-05 15:10:37 +03:00
dependabot[bot] ed23fb9054 Upgrade regex and regex-syntax
Bump regex from 1.7.3 to 1.9.1

Bumps [regex](https://github.com/rust-lang/regex) from 1.7.3 to 1.8.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com

Bump regex-syntax from 0.6.29 to 0.7.2

Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.6.29 to 0.7.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/commits)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-minor

Supersedes: #1334
Supersedes: #1343
Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 01:02:55 -06:00
Utkarsh Gupta 3ae04546ea Replace `dirs-next` crate with `etcetera` crate 2023-06-14 21:22:28 +02:00
Thayne McCombs 740edeb73f Replace atty with std
std now has a function for testing if stdout is a tty
2023-06-08 00:10:53 -06:00
Thayne McCombs 91e3c3cba5 Replace once_cell with stdlib
LazyLock isn't standardized yet, but OnceLock is good enough for what we
need.
2023-06-08 00:05:00 -06:00
Nathan Houghton 42244e5f32 Don't use jemalloc on OpenBSD (jemalloc fails to compile) 2023-04-14 21:24:19 +02:00