Merge remote-tracking branch 'origin/master' into yyogo/master
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by David Peter · parents 60c14b1, dcde6d3 · Browse files · 9 files·+76 added−56 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+76 added−56 removed
- tests:+1 added−13 removed
- other:+75 added−43 removed
Provenance
- Commit
41affe1- Tree
df92fa0- Author
David Peter <mail@david-peter.de>- Committer
David Peter <mail@david-peter.de>- Parent 1
60c14b1- Parent 2
dcde6d3
9 files changed+76 added−56 removed
modified:doc/fd.1+1 added-1 removed
56 unmodified lines57 .IP58 The flag can be overridden with '--ignore'.59 .TP60 .B \-u, \-\-unrestricted61-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'.62 .TP63 .B \-\-no\-ignore\-vcs64 Show search results from files and directories that would otherwise be ignored by gitignore files65 including399 unmodified linesmodified:src/app.rs+4 added-4 removed
100 unmodified lines101 Arg::new("rg-alias-hidden-ignore")102 .short('u')103 .long("unrestricted")104 .overrides_with_all(&["ignore", "no-hidden"])105- .multiple_occurrences(true)105+ .multiple_occurrences(true) // Allowed for historical reasons106 .hide_short_help(true)107- .help("Alias for '--no-ignore', and '--hidden' when given twice")107+ .help("Unrestricted search, alias for '--no-ignore --hidden'")108 .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'."111 ),112 )113 .arg(114 Arg::new("case-sensitive")658 unmodified linesmodified:src/main.rs+1 added-1 removed
258 unmodified lines259 Ok(Config {260 case_sensitive,261 search_full_path: matches.is_present("full-path"),262 ignore_hidden: !(matches.is_present("hidden")263- || matches.occurrences_of("rg-alias-hidden-ignore") >= 2),263+ || matches.is_present("rg-alias-hidden-ignore")),264 read_fdignore: !(matches.is_present("no-ignore")265 || matches.is_present("rg-alias-hidden-ignore")),266 read_vcsignore: !(matches.is_present("no-ignore")267 || matches.is_present("rg-alias-hidden-ignore")302 unmodified linesmodified:src/regex_helper.rs+10 added-10 removed
13 unmodified lines14 /// Determine if a regex expression contains a literal uppercase character.15 fn hir_has_uppercase_char(hir: &Hir) -> bool {16 use regex_syntax::hir::*;17 18- match *hir.kind() {18+ match hir.kind() {19 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)) => ranges20+ HirKind::Literal(Literal::Byte(b)) => char::from(*b).is_uppercase(),21+ HirKind::Class(Class::Unicode(ranges)) => ranges22 .iter()23 .any(|r| r.start().is_uppercase() || r.end().is_uppercase()),24- HirKind::Class(Class::Bytes(ref ranges)) => ranges24+ HirKind::Class(Class::Bytes(ranges)) => ranges25 .iter()26 .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, .. }) => {28 hir_has_uppercase_char(hir)29 }30- HirKind::Concat(ref hirs) | HirKind::Alternation(ref hirs) => {30+ HirKind::Concat(hirs) | HirKind::Alternation(hirs) => {31 hirs.iter().any(hir_has_uppercase_char)32 }33 _ => false,34 }16 unmodified lines51 // Note: this only really detects the simplest case where a regex starts with52 // "^\\.", i.e. a start text anchor and a literal dot character. There are a lot53 // of other patterns that ONLY match hidden files, e.g. ^(\\.foo|\\.bar) which are54 // not (yet) detected by this algorithm.55- match *hir.kind() {56- HirKind::Concat(ref hirs) => {55+ match hir.kind() {56+ HirKind::Concat(hirs) => {57 let mut hirs = hirs.iter();58 if let Some(hir) = hirs.next() {59- if *hir.kind() != HirKind::Anchor(Anchor::StartText) {59+ if hir.kind() != &HirKind::Anchor(Anchor::StartText) {60 return false;61 }62 } else {63 return false;64 }65 66 if let Some(hir) = hirs.next() {67- *hir.kind() == HirKind::Literal(Literal::Unicode('.'))67+ hir.kind() == &HirKind::Literal(Literal::Unicode('.'))68 } else {69 false70 }71 }29 unmodified linesmodified:tests/tests.rs+1 added-13 removed
654 unmodified lines655 let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);656 657 te.assert_output(658 &["-u", "foo"],659- "./a.foo660- ./fdignored.foo661- ./gitignored.foo662- ./one/b.foo663- ./one/two/c.foo664- ./one/two/C.Foo2665- ./one/two/three/d.foo666- ./one/two/three/directory_foo/",667- );668-669- te.assert_output(670- &["-uu", "foo"],659 "./.hidden.foo660 ./a.foo661 ./fdignored.foo662 ./gitignored.foo1363 unmodified lines2026 #[test_case("--no-ignore", &["--ignore"] ; "no-ignore")]2027 #[test_case("--no-ignore-vcs", &["--ignore-vcs"] ; "no-ignore-vcs")]2028 #[test_case("--follow", &["--no-follow"] ; "follow")]2029 #[test_case("--absolute-path", &["--relative-path"] ; "absolute-path")]2042-#[test_case("-u", &["--ignore"] ; "u")]2030+#[test_case("-u", &["--ignore", "--no-hidden"] ; "u")]2031 #[test_case("-uu", &["--ignore", "--no-hidden"] ; "uu")]2032 fn test_opposing(flag: &str, opposing_flags: &[&str]) {2033 let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);2034 48 unmodified linesmodified:Cargo.lock+28 added-23 removed
20 unmodified lines21 ]22 23 [[package]]24 name = "anyhow"25-version = "1.0.55"25+version = "1.0.57"26 source = "registry+https://github.com/rust-lang/crates.io-index"27-checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd"27+checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"28 29 [[package]]30 name = "atty"31 version = "0.2.14"52 unmodified lines84 ]85 86 [[package]]87 name = "clap"88-version = "3.1.5"88+version = "3.1.14"89 source = "registry+https://github.com/rust-lang/crates.io-index"90-checksum = "ced1892c55c910c1219e98d6fc8d71f6bddba7905866ce740066d8bfea859312"90+checksum = "535434c063ced786eb04aaf529308092c5ab60889e8fe24275d15de07b01fa97"91 dependencies = [92 "atty",93 "bitflags",94+ "clap_lex",95 "indexmap",96 "lazy_static",96- "os_str_bytes",97 "strsim",98 "termcolor",99 "terminal_size",100 "textwrap",101 ]102 103 [[package]]104 name = "clap_complete"105-version = "3.1.1"105+version = "3.1.3"106 source = "registry+https://github.com/rust-lang/crates.io-index"107-checksum = "df6f3613c0a3cddfd78b41b10203eb322cb29b600cbdf808a7d3db95691b8e25"107+checksum = "1d7ca9141e27e6ebc52e3c378b0c07f3cea52db46ed1cc5861735fb697b56356"108 dependencies = [109 "clap",110 ]111 112 [[package]]113+name = "clap_lex"114+version = "0.2.0"115+source = "registry+https://github.com/rust-lang/crates.io-index"116+checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213"117+dependencies = [118+ "os_str_bytes",119+]120+121+[[package]]122 name = "crossbeam-utils"123 version = "0.8.7"124 source = "registry+https://github.com/rust-lang/crates.io-index"125 checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6"3 unmodified lines129 ]130 131 [[package]]132 name = "ctrlc"124-version = "3.2.1"133+version = "3.2.2"134 source = "registry+https://github.com/rust-lang/crates.io-index"126-checksum = "a19c6cedffdc8c03a3346d723eb20bd85a13362bb96dc2ac000842c6381ec7bf"135+checksum = "b37feaa84e6861e00a1f5e5aa8da3ee56d605c9992d33e082786754828e20865"136 dependencies = [137 "nix",138 "winapi",139 ]188 unmodified lines328 checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"329 330 [[package]]331 name = "libc"323-version = "0.2.119"332+version = "0.2.125"333 source = "registry+https://github.com/rust-lang/crates.io-index"325-checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4"334+checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"335 336 [[package]]337 name = "log"338 version = "0.4.14"28 unmodified lines367 ]368 369 [[package]]370 name = "nix"362-version = "0.23.1"371+version = "0.24.1"372 source = "registry+https://github.com/rust-lang/crates.io-index"364-checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"373+checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"374 dependencies = [375 "bitflags",367- "cc",376 "cfg-if",377 "libc",378 "memoffset",379 ]37 unmodified lines417 ]418 419 [[package]]420 name = "once_cell"413-version = "1.9.0"421+version = "1.10.0"422 source = "registry+https://github.com/rust-lang/crates.io-index"415-checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"423+checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"424 425 [[package]]426 name = "os_str_bytes"427 version = "6.0.0"428 source = "registry+https://github.com/rust-lang/crates.io-index"429 checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"422-dependencies = [423- "memchr",424-]430 431 [[package]]432 name = "proc-macro-error"433 version = "1.0.4"93 unmodified lines527 ]528 529 [[package]]530 name = "regex"526-version = "1.5.4"531+version = "1.5.5"532 source = "registry+https://github.com/rust-lang/crates.io-index"528-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"533+checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"534 dependencies = [535 "aho-corasick",536 "memchr",537 "regex-syntax",70 unmodified lines608 ]609 610 [[package]]611 name = "test-case"607-version = "2.0.0"612+version = "2.0.2"613 source = "registry+https://github.com/rust-lang/crates.io-index"609-checksum = "4f7d58e237f65d5fe5eaf1105188c94c9a441e1fbc298ed5df45ec9c9af236d3"614+checksum = "6344589a99d3971d6fa4e8314dbcbeca2df6273a6b642e46906971779159af1f"615 dependencies = [616 "cfg-if",617 "proc-macro-error",618 "proc-macro2",101 unmodified linesmodified:Cargo.toml+3 added-3 removed
37 unmodified lines38394041424243444546474849505152525354555657585960606162636419 unmodified lines37 unmodified linesansi_term = "0.12"atty = "0.2"ignore = "0.4.3"num_cpus = "1.13"regex = "1.5.4"regex = "1.5.5"regex-syntax = "0.6"ctrlc = "3.2"humantime = "2.1"lscolors = "0.9"globset = "0.4"anyhow = "1.0"dirs-next = "2.0"normpath = "0.3.2"chrono = "0.4"once_cell = "1.9.0"once_cell = "1.10.0"
[dependencies.clap]version = "3.1"features = ["suggestions", "color", "wrap_help", "cargo", "unstable-grouped"]
[target.'cfg(unix)'.dependencies]users = "0.11.0"nix = "0.23.1"nix = "0.24.1"
[target.'cfg(all(unix, not(target_os = "redox")))'.dependencies]libc = "0.2"
19 unmodified linesmodified:CHANGELOG.md+5 added-1 removed
3 unmodified lines4 5 6 ## Features7 8+- Support multiple `--exec <cmd>` instances, see #406 and 9+#960 (@tmccombs)10 11 ## Bugfixes12 13 14 ## Changes15 16+- Changed `-u` flag to be equivalent to `-HI`. Multiple `-u` flags still allowed but do nothing, see #840 (@jacksontheel)14-- Directories are now printed with an additional path separator at the end: `foo/bar/`17+- Directories are now printed with an additional path separator at the end: `foo/bar/`, see #436 and #812 (@yyogo)18 19 ## Other20 21+- Added installation instructions for RHEL8, see #989 (@ethsol)22 23 # v8.3.224 25 ## Bugfixes568 unmodified linesmodified:README.md+23 added
590 unmodified lines591 ```592 xbps-install -S fd593 ```594 595+### On RedHat Enterprise Linux 8 (RHEL8) or Almalinux 8 or Rocky Linux 8596+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.gz600+chown -R root:root fd-v*-x86_64-unknown-linux-gnu601+cd fd-v*-x86_64-unknown-linux-gnu602+sudo cp fd /bin603+gzip fd.1604+chown root:root fd.1.gz605+sudo cp fd.1.gz /usr/share/man/man1606+sudo cp autocomplete/fd.bash /usr/share/bash-completion/completions/fd607+source /usr/share/bash-completion/completions/fd608+fd 609+```610+611 ### On macOS612 613 You can install `fd` with [Homebrew](https://formulae.brew.sh/formula/fd):614 ```18 unmodified lines633 ```634 choco install fd635 ```636 637+### On GuixOS638+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 fd642+```643+644 ### On NixOS / via Nix645 646 You can use the [Nix package manager](https://nixos.org/nix/) to install `fd`:647 ```60 unmodified lines