Skip to content

Commit 41affe1

Browse files
committed
Merge remote-tracking branch 'origin/master' into yyogo/master
2 parents 60c14b1 + dcde6d3 commit 41affe1

File tree

9 files changed

+76
-56
lines changed

9 files changed

+76
-56
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55

66
## Features
77

8+
- Support multiple `--exec <cmd>` instances, see #406 and
9+
#960 (@tmccombs)
810

911
## Bugfixes
1012

1113

1214
## Changes
1315

14-
- Directories are now printed with an additional path separator at the end: `foo/bar/`
16+
- Changed `-u` flag to be equivalent to `-HI`. Multiple `-u` flags still allowed but do nothing, see #840 (@jacksontheel)
17+
- Directories are now printed with an additional path separator at the end: `foo/bar/`, see #436 and #812 (@yyogo)
1518

1619
## Other
1720

21+
- Added installation instructions for RHEL8, see #989 (@ethsol)
1822

1923
# v8.3.2
2024

Cargo.lock

+28-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ansi_term = "0.12"
3939
atty = "0.2"
4040
ignore = "0.4.3"
4141
num_cpus = "1.13"
42-
regex = "1.5.4"
42+
regex = "1.5.5"
4343
regex-syntax = "0.6"
4444
ctrlc = "3.2"
4545
humantime = "2.1"
@@ -49,15 +49,15 @@ anyhow = "1.0"
4949
dirs-next = "2.0"
5050
normpath = "0.3.2"
5151
chrono = "0.4"
52-
once_cell = "1.9.0"
52+
once_cell = "1.10.0"
5353

5454
[dependencies.clap]
5555
version = "3.1"
5656
features = ["suggestions", "color", "wrap_help", "cargo", "unstable-grouped"]
5757

5858
[target.'cfg(unix)'.dependencies]
5959
users = "0.11.0"
60-
nix = "0.23.1"
60+
nix = "0.24.1"
6161

6262
[target.'cfg(all(unix, not(target_os = "redox")))'.dependencies]
6363
libc = "0.2"

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,22 @@ You can install `fd` via xbps-install:
592592
xbps-install -S fd
593593
```
594594

595+
### On RedHat Enterprise Linux 8 (RHEL8) or Almalinux 8 or Rocky Linux 8
596+
597+
Get the latest fd-v*-x86_64-unknown-linux-gnu.tar.gz file from [sharkdp on github](https://github.com/sharkdp/fd/releases)
598+
```
599+
tar xf fd-v*-x86_64-unknown-linux-gnu.tar.gz
600+
chown -R root:root fd-v*-x86_64-unknown-linux-gnu
601+
cd fd-v*-x86_64-unknown-linux-gnu
602+
sudo cp fd /bin
603+
gzip fd.1
604+
chown root:root fd.1.gz
605+
sudo cp fd.1.gz /usr/share/man/man1
606+
sudo cp autocomplete/fd.bash /usr/share/bash-completion/completions/fd
607+
source /usr/share/bash-completion/completions/fd
608+
fd
609+
```
610+
595611
### On macOS
596612

597613
You can install `fd` with [Homebrew](https://formulae.brew.sh/formula/fd):
@@ -618,6 +634,13 @@ Or via [Chocolatey](https://chocolatey.org):
618634
choco install fd
619635
```
620636

637+
### On GuixOS
638+
639+
You can install [the fd package](https://guix.gnu.org/en/packages/fd-8.1.1/) from the official repo:
640+
```
641+
guix install fd
642+
```
643+
621644
### On NixOS / via Nix
622645

623646
You can use the [Nix package manager](https://nixos.org/nix/) to install `fd`:

doc/fd.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The global fd ignore file (usually
5858
The flag can be overridden with '--ignore'.
5959
.TP
6060
.B \-u, \-\-unrestricted
61-
Alias for '--no-ignore'. Can be repeated; '-uu' is an alias for '--no-ignore --hidden'.
61+
Perform an unrestricted search, including ignored and hidden files. This is an alias for '--hidden --no-ignore'.
6262
.TP
6363
.B \-\-no\-ignore\-vcs
6464
Show search results from files and directories that would otherwise be ignored by gitignore files

src/app.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ pub fn build_app() -> Command<'static> {
102102
.short('u')
103103
.long("unrestricted")
104104
.overrides_with_all(&["ignore", "no-hidden"])
105-
.multiple_occurrences(true)
105+
.multiple_occurrences(true) // Allowed for historical reasons
106106
.hide_short_help(true)
107-
.help("Alias for '--no-ignore', and '--hidden' when given twice")
107+
.help("Unrestricted search, alias for '--no-ignore --hidden'")
108108
.long_help(
109-
"Alias for '--no-ignore'. Can be repeated. '-uu' is an alias for \
110-
'--no-ignore --hidden'.",
109+
"Perform an unrestricted search, including ignored and hidden files. This is \
110+
an alias for '--no-ignore --hidden'."
111111
),
112112
)
113113
.arg(

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ fn construct_config(matches: clap::ArgMatches, pattern_regex: &str) -> Result<Co
260260
case_sensitive,
261261
search_full_path: matches.is_present("full-path"),
262262
ignore_hidden: !(matches.is_present("hidden")
263-
|| matches.occurrences_of("rg-alias-hidden-ignore") >= 2),
263+
|| matches.is_present("rg-alias-hidden-ignore")),
264264
read_fdignore: !(matches.is_present("no-ignore")
265265
|| matches.is_present("rg-alias-hidden-ignore")),
266266
read_vcsignore: !(matches.is_present("no-ignore")

src/regex_helper.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ pub fn pattern_has_uppercase_char(pattern: &str) -> bool {
1515
fn hir_has_uppercase_char(hir: &Hir) -> bool {
1616
use regex_syntax::hir::*;
1717

18-
match *hir.kind() {
18+
match hir.kind() {
1919
HirKind::Literal(Literal::Unicode(c)) => c.is_uppercase(),
20-
HirKind::Literal(Literal::Byte(b)) => char::from(b).is_uppercase(),
21-
HirKind::Class(Class::Unicode(ref ranges)) => ranges
20+
HirKind::Literal(Literal::Byte(b)) => char::from(*b).is_uppercase(),
21+
HirKind::Class(Class::Unicode(ranges)) => ranges
2222
.iter()
2323
.any(|r| r.start().is_uppercase() || r.end().is_uppercase()),
24-
HirKind::Class(Class::Bytes(ref ranges)) => ranges
24+
HirKind::Class(Class::Bytes(ranges)) => ranges
2525
.iter()
2626
.any(|r| char::from(r.start()).is_uppercase() || char::from(r.end()).is_uppercase()),
27-
HirKind::Group(Group { ref hir, .. }) | HirKind::Repetition(Repetition { ref hir, .. }) => {
27+
HirKind::Group(Group { hir, .. }) | HirKind::Repetition(Repetition { hir, .. }) => {
2828
hir_has_uppercase_char(hir)
2929
}
30-
HirKind::Concat(ref hirs) | HirKind::Alternation(ref hirs) => {
30+
HirKind::Concat(hirs) | HirKind::Alternation(hirs) => {
3131
hirs.iter().any(hir_has_uppercase_char)
3232
}
3333
_ => false,
@@ -52,19 +52,19 @@ fn hir_matches_strings_with_leading_dot(hir: &Hir) -> bool {
5252
// "^\\.", i.e. a start text anchor and a literal dot character. There are a lot
5353
// of other patterns that ONLY match hidden files, e.g. ^(\\.foo|\\.bar) which are
5454
// not (yet) detected by this algorithm.
55-
match *hir.kind() {
56-
HirKind::Concat(ref hirs) => {
55+
match hir.kind() {
56+
HirKind::Concat(hirs) => {
5757
let mut hirs = hirs.iter();
5858
if let Some(hir) = hirs.next() {
59-
if *hir.kind() != HirKind::Anchor(Anchor::StartText) {
59+
if hir.kind() != &HirKind::Anchor(Anchor::StartText) {
6060
return false;
6161
}
6262
} else {
6363
return false;
6464
}
6565

6666
if let Some(hir) = hirs.next() {
67-
*hir.kind() == HirKind::Literal(Literal::Unicode('.'))
67+
hir.kind() == &HirKind::Literal(Literal::Unicode('.'))
6868
} else {
6969
false
7070
}

tests/tests.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -656,18 +656,6 @@ fn test_no_ignore_aliases() {
656656

657657
te.assert_output(
658658
&["-u", "foo"],
659-
"./a.foo
660-
./fdignored.foo
661-
./gitignored.foo
662-
./one/b.foo
663-
./one/two/c.foo
664-
./one/two/C.Foo2
665-
./one/two/three/d.foo
666-
./one/two/three/directory_foo/",
667-
);
668-
669-
te.assert_output(
670-
&["-uu", "foo"],
671659
"./.hidden.foo
672660
./a.foo
673661
./fdignored.foo
@@ -2039,7 +2027,7 @@ fn test_number_parsing_errors() {
20392027
#[test_case("--no-ignore-vcs", &["--ignore-vcs"] ; "no-ignore-vcs")]
20402028
#[test_case("--follow", &["--no-follow"] ; "follow")]
20412029
#[test_case("--absolute-path", &["--relative-path"] ; "absolute-path")]
2042-
#[test_case("-u", &["--ignore"] ; "u")]
2030+
#[test_case("-u", &["--ignore", "--no-hidden"] ; "u")]
20432031
#[test_case("-uu", &["--ignore", "--no-hidden"] ; "uu")]
20442032
fn test_opposing(flag: &str, opposing_flags: &[&str]) {
20452033
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);

0 commit comments

Comments
 (0)