Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package fd for openSUSE:Factory checked in at 2023-02-28 12:48:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fd (Old) and /work/SRC/openSUSE:Factory/.fd.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "fd" Tue Feb 28 12:48:51 2023 rev:18 rq:1068036 version:8.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/fd/fd.changes 2023-01-15 17:58:10.762207628 +0100 +++ /work/SRC/openSUSE:Factory/.fd.new.31432/fd.changes 2023-02-28 12:49:15.576713706 +0100 @@ -1,0 +2,11 @@ +Mon Feb 27 09:28:13 UTC 2023 - andrea.manzini@suse.com + +- Update to version 8.7.0: + * Bump dependencies + * Add flag --no-require-git to always respect gitignore files + * Skip an executable test if running as root + * updates for windows platform + * Fix logic for when to read global ignore file + * Add Upcoming release to changelog + +------------------------------------------------------------------- Old: ---- fd-8.5.0.obscpio fd-8.6.0.obscpio fd-8.6.0.tar.xz New: ---- fd-8.7.0.obscpio fd-8.7.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fd.spec ++++++ --- /var/tmp/diff_new_pack.QdDXEf/_old 2023-02-28 12:49:16.640719548 +0100 +++ /var/tmp/diff_new_pack.QdDXEf/_new 2023-02-28 12:49:16.644719570 +0100 @@ -17,7 +17,7 @@ Name: fd -Version: 8.6.0 +Version: 8.7.0 Release: 0 Summary: An alternative to the "find" utility License: Apache-2.0 AND MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.QdDXEf/_old 2023-02-28 12:49:16.676719745 +0100 +++ /var/tmp/diff_new_pack.QdDXEf/_new 2023-02-28 12:49:16.680719767 +0100 @@ -3,7 +3,7 @@ <param name="url">https://github.com/sharkdp/fd.git</param> <param name="versionformat">@PARENT_TAG@</param> <param name="scm">git</param> - <param name="revision">v8.6.0</param> + <param name="revision">v8.7.0</param> <param name="match-tag">*</param> <param name="versionrewrite-pattern">v(\d+\.\d+\.\d+)</param> <param name="versionrewrite-replacement">\1</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.QdDXEf/_old 2023-02-28 12:49:16.700719877 +0100 +++ /var/tmp/diff_new_pack.QdDXEf/_new 2023-02-28 12:49:16.700719877 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/sharkdp/fd.git</param> - <param name="changesrevision">d5bca085dd9f9091226bc01dc9b579979aad735f</param></service></servicedata> + <param name="changesrevision">840a565d3aadbeb303b10a01c0aa3561924dfc46</param></service></servicedata> (No newline at EOF) ++++++ fd-8.5.0.obscpio -> fd-8.7.0.obscpio ++++++ ++++ 3144 lines of diff (skipped) ++++++ fd-8.6.0.tar.xz -> fd-8.7.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/.github/workflows/CICD.yml new/fd-8.7.0/.github/workflows/CICD.yml --- old/fd-8.6.0/.github/workflows/CICD.yml 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/.github/workflows/CICD.yml 2023-02-24 08:14:46.000000000 +0100 @@ -1,7 +1,7 @@ name: CICD env: - MIN_SUPPORTED_RUST_VERSION: "1.60.0" + MIN_SUPPORTED_RUST_VERSION: "1.64.0" CICD_INTERMEDIATES_DIR: "_cicd-intermediates" on: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/CHANGELOG.md new/fd-8.7.0/CHANGELOG.md --- old/fd-8.6.0/CHANGELOG.md 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/CHANGELOG.md 2023-02-24 08:14:46.000000000 +0100 @@ -1,3 +1,19 @@ +# v8.7.0 + +## Features + +- Add flag --no-require-git to always respect gitignore files, see #1216 (@vegerot) + +## Bugfixes + +- Fix logic for when to use global ignore file. There was a bug where the only case where the + global ignore file wasn't processed was if `--no-ignore` was passed, but neither `--unrestricted` + nor `--no-global-ignore-file` is passed. See #1209 + +## Changes + +## Other + # v8.6.0 ## Features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/CONTRIBUTING.md new/fd-8.7.0/CONTRIBUTING.md --- old/fd-8.6.0/CONTRIBUTING.md 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/CONTRIBUTING.md 2023-02-24 08:14:46.000000000 +0100 @@ -13,11 +13,11 @@ ## Add an entry to the changelog If your contribution changes the behavior of `fd` (as opposed to a typo-fix -in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md) file +in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md#upcoming-release) file and describe your changes. This makes the release process much easier and therefore helps to get your changes into a new `fd` release faster. -The top of the `CHANGELOG` contains a *"unreleased"* section with a few +The top of the `CHANGELOG` contains an *"Upcoming release"* section with a few subsections (Features, Bugfixes, ���). Please add your entry to the subsection that best describes your change. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/Cargo.lock new/fd-8.7.0/Cargo.lock --- old/fd-8.6.0/Cargo.lock 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/Cargo.lock 2023-02-24 08:14:46.000000000 +0100 @@ -22,9 +22,9 @@ [[package]] name = "anyhow" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" [[package]] name = "argmax" @@ -34,7 +34,7 @@ dependencies = [ "lazy_static", "libc", - "nix 0.24.2", + "nix 0.24.3", ] [[package]] @@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -101,14 +101,14 @@ [[package]] name = "clap" -version = "4.0.22" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682" +checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2" dependencies = [ - "atty", "bitflags", "clap_derive", "clap_lex", + "is-terminal", "once_cell", "strsim", "termcolor", @@ -126,9 +126,9 @@ [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" dependencies = [ "heck", "proc-macro-error", @@ -187,7 +187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d91974fbbe88ec1df0c24a4f00f99583667a7e2e6272b2b92d294d81e462173" dependencies = [ - "nix 0.25.0", + "nix 0.25.1", "winapi", ] @@ -305,7 +305,7 @@ [[package]] name = "fd-find" -version = "8.6.0" +version = "8.7.0" dependencies = [ "anyhow", "argmax", @@ -325,7 +325,7 @@ "jemallocator", "libc", "lscolors", - "nix 0.24.2", + "nix 0.26.2", "normpath", "nu-ansi-term", "num_cpus", @@ -402,6 +402,15 @@ ] [[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -465,6 +474,28 @@ checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0" [[package]] +name = "io-lifetimes" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "is-terminal" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes 1.0.4", + "rustix 0.36.6", + "windows-sys 0.42.0", +] + +[[package]] name = "jemalloc-sys" version = "0.5.2+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -522,6 +553,12 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] name = "log" version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -547,9 +584,9 @@ [[package]] name = "nix" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", "cfg-if", @@ -558,9 +595,9 @@ [[package]] name = "nix" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", "bitflags", @@ -569,6 +606,18 @@ ] [[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "static_assertions", +] + +[[package]] name = "normpath" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -608,19 +657,19 @@ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "once_cell" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "os_str_bytes" @@ -698,9 +747,9 @@ [[package]] name = "regex" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -709,9 +758,9 @@ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -730,13 +779,27 @@ dependencies = [ "bitflags", "errno", - "io-lifetimes", + "io-lifetimes 0.7.4", "libc", - "linux-raw-sys", + "linux-raw-sys 0.0.46", "windows-sys 0.36.1", ] [[package]] +name = "rustix" +version = "0.36.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 1.0.4", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.42.0", +] + +[[package]] name = "same-file" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -752,6 +815,12 @@ checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" [[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -797,7 +866,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1" dependencies = [ - "rustix", + "rustix 0.35.12", "windows-sys 0.36.1", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/Cargo.toml new/fd-8.7.0/Cargo.toml --- old/fd-8.6.0/Cargo.toml 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/Cargo.toml 2023-02-24 08:14:46.000000000 +0100 @@ -16,8 +16,9 @@ name = "fd-find" readme = "README.md" repository = "https://github.com/sharkdp/fd" -version = "8.6.0" +version = "8.7.0" edition= "2021" +rust-version = "1.64.0" [badges.appveyor] repository = "sharkdp/fd" @@ -37,8 +38,8 @@ argmax = "0.3.1" atty = "0.2" ignore = "0.4.3" -num_cpus = "1.13" -regex = "1.7.0" +num_cpus = "1.15" +regex = "1.7.1" regex-syntax = "0.6" ctrlc = "3.2" humantime = "2.1" @@ -46,13 +47,13 @@ anyhow = "1.0" dirs-next = "2.0" normpath = "0.3.2" -once_cell = "1.15.0" +once_cell = "1.17.0" crossbeam-channel = "0.5.6" clap_complete = {version = "4.0.6", optional = true} faccess = "0.2.4" [dependencies.clap] -version = "4.0.22" +version = "4.1.1" features = ["suggestions", "color", "wrap_help", "cargo", "unstable-grouped", "derive"] [dependencies.chrono] @@ -67,7 +68,7 @@ [target.'cfg(unix)'.dependencies] users = "0.11.0" -nix = { version = "0.24.2", default-features = false, features = ["signal"] } +nix = { version = "0.26.2", default-features = false, features = ["signal"] } [target.'cfg(all(unix, not(target_os = "redox")))'.dependencies] libc = "0.2" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/README.md new/fd-8.7.0/README.md --- old/fd-8.6.0/README.md 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/README.md 2023-02-24 08:14:46.000000000 +0100 @@ -324,8 +324,8 @@ -X, --exec-batch <cmd>... Execute a command with all search results at once -c, --color <when> When to use colors [default: auto] [possible values: auto, always, never] - -h, --help Print help information (use `--help` for more detail) - -V, --version Print version information + -h, --help Print help (see more with '--help') + -V, --version Print version ``` ## Benchmark @@ -540,7 +540,7 @@ If you use an older version of Ubuntu, you can download the latest `.deb` package from the [release page](https://github.com/sharkdp/fd/releases) and install it via: ``` bash -sudo dpkg -i fd_8.6.0_amd64.deb # adapt version number and architecture +sudo dpkg -i fd_8.7.0_amd64.deb # adapt version number and architecture ``` ### On Debian @@ -639,6 +639,11 @@ choco install fd ``` +Or via [Winget](https://learn.microsoft.com/en-us/windows/package-manager/): +``` +winget install sharkdp.fd +``` + ### On GuixOS You can install [the fd package](https://guix.gnu.org/en/packages/fd-8.1.1/) from the official repo: @@ -674,7 +679,7 @@ ``` cargo install fd-find ``` -Note that rust version *1.60.0* or later is required. +Note that rust version *1.64.0* or later is required. `make` is also needed for the build. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/build.rs new/fd-8.7.0/build.rs --- old/fd-8.6.0/build.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/build.rs 2023-02-24 08:14:46.000000000 +0100 @@ -1,5 +1,5 @@ fn main() { - let min_version = "1.60"; + let min_version = "1.64"; match version_check::is_min_version(min_version) { Some(true) => {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/clippy.toml new/fd-8.7.0/clippy.toml --- old/fd-8.6.0/clippy.toml 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/clippy.toml 2023-02-24 08:14:46.000000000 +0100 @@ -1 +1 @@ -msrv = "1.60.0" +msrv = "1.64.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/src/cli.rs new/fd-8.7.0/src/cli.rs --- old/fd-8.6.0/src/cli.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/src/cli.rs 2023-02-24 08:14:46.000000000 +0100 @@ -74,6 +74,28 @@ #[arg(long, overrides_with = "no_ignore_vcs", hide = true, action = ArgAction::SetTrue)] ignore_vcs: (), + /// Do not require a git repository to respect gitignores. + /// By default, fd will only respect global gitignore rules, .gitignore rules, + /// and local exclude rules if fd detects that you are searching inside a + /// git repository. This flag allows you to relax this restriction such that + /// fd will respect all git related ignore rules regardless of whether you're + /// searching in a git repository or not. + /// + /// + /// This flag can be disabled with --require-git. + #[arg( + long, + overrides_with = "require_git", + hide_short_help = true, + // same description as ripgrep's flag: ripgrep/crates/core/app.rs + long_help + )] + pub no_require_git: bool, + + /// Overrides --no-require-git + #[arg(long, overrides_with = "no_require_git", hide = true, action = ArgAction::SetTrue)] + require_git: (), + /// Show search results from files and directories that would otherwise be /// ignored by '.gitignore', '.ignore', or '.fdignore' files in parent directories. #[arg( @@ -738,11 +760,11 @@ impl clap::FromArgMatches for Exec { fn from_arg_matches(matches: &ArgMatches) -> clap::error::Result<Self> { let command = matches - .grouped_values_of("exec") + .get_occurrences::<String>("exec") .map(CommandSet::new) .or_else(|| { matches - .grouped_values_of("exec_batch") + .get_occurrences::<String>("exec_batch") .map(CommandSet::new_batch) }) .transpose() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/src/config.rs new/fd-8.7.0/src/config.rs --- old/fd-8.6.0/src/config.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/src/config.rs 2023-02-24 08:14:46.000000000 +0100 @@ -30,6 +30,9 @@ /// Whether to respect VCS ignore files (`.gitignore`, ..) or not. pub read_vcsignore: bool, + /// Whether to require a `.git` directory to respect gitignore files. + pub require_git_to_read_vcsignore: bool, + /// Whether to respect the global ignore file or not. pub read_global_ignore: bool, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/src/exec/mod.rs new/fd-8.7.0/src/exec/mod.rs --- old/fd-8.6.0/src/exec/mod.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/src/exec/mod.rs 2023-02-24 08:14:46.000000000 +0100 @@ -39,9 +39,10 @@ } impl CommandSet { - pub fn new<I, S>(input: I) -> Result<CommandSet> + pub fn new<I, T, S>(input: I) -> Result<CommandSet> where - I: IntoIterator<Item = Vec<S>>, + I: IntoIterator<Item = T>, + T: IntoIterator<Item = S>, S: AsRef<str>, { Ok(CommandSet { @@ -53,9 +54,10 @@ }) } - pub fn new_batch<I, S>(input: I) -> Result<CommandSet> + pub fn new_batch<I, T, S>(input: I) -> Result<CommandSet> where - I: IntoIterator<Item = Vec<S>>, + I: IntoIterator<Item = T>, + T: IntoIterator<Item = S>, S: AsRef<str>, { Ok(CommandSet { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/src/main.rs new/fd-8.7.0/src/main.rs --- old/fd-8.6.0/src/main.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/src/main.rs 2023-02-24 08:14:46.000000000 +0100 @@ -239,8 +239,11 @@ ignore_hidden: !(opts.hidden || opts.rg_alias_ignore()), read_fdignore: !(opts.no_ignore || opts.rg_alias_ignore()), read_vcsignore: !(opts.no_ignore || opts.rg_alias_ignore() || opts.no_ignore_vcs), + require_git_to_read_vcsignore: !opts.no_require_git, read_parent_ignore: !opts.no_ignore_parent, - read_global_ignore: !opts.no_ignore || opts.rg_alias_ignore() || opts.no_global_ignore_file, + read_global_ignore: !(opts.no_ignore + || opts.rg_alias_ignore() + || opts.no_global_ignore_file), follow_links: opts.follow, one_file_system: opts.one_file_system, null_separator: opts.null_separator, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/src/walk.rs new/fd-8.7.0/src/walk.rs --- old/fd-8.6.0/src/walk.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/src/walk.rs 2023-02-24 08:14:46.000000000 +0100 @@ -77,6 +77,7 @@ .git_ignore(config.read_vcsignore) .git_global(config.read_vcsignore) .git_exclude(config.read_vcsignore) + .require_git(config.require_git_to_read_vcsignore) .overrides(overrides) .follow_links(config.follow_links) // No need to check for supported platforms, option is unavailable on unsupported ones diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/tests/testenv/mod.rs new/fd-8.7.0/tests/testenv/mod.rs --- old/fd-8.6.0/tests/testenv/mod.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/tests/testenv/mod.rs 2023-02-24 08:14:46.000000000 +0100 @@ -20,6 +20,9 @@ /// Normalize each line by sorting the whitespace-separated words normalize_line: bool, + + /// Temporary directory for storing test config (global ignore file) + config_dir: Option<TempDir>, } /// Create the working directory and the test files. @@ -59,6 +62,16 @@ Ok(temp_dir) } +fn create_config_directory_with_global_ignore(ignore_file_content: &str) -> io::Result<TempDir> { + let config_dir = tempfile::Builder::new().prefix("fd-config").tempdir()?; + let fd_dir = config_dir.path().join("fd"); + fs::create_dir(&fd_dir)?; + let mut ignore_file = fs::File::create(fd_dir.join("ignore"))?; + ignore_file.write_all(ignore_file_content.as_bytes())?; + + Ok(config_dir) +} + /// Find the *fd* executable. fn find_fd_exe() -> PathBuf { // Tests exe is in target/debug/deps, the *fd* exe is in target/debug @@ -150,6 +163,7 @@ temp_dir, fd_exe, normalize_line: false, + config_dir: None, } } @@ -158,6 +172,16 @@ temp_dir: self.temp_dir, fd_exe: self.fd_exe, normalize_line: normalize, + config_dir: self.config_dir, + } + } + + pub fn global_ignore_file(self, content: &str) -> TestEnv { + let config_dir = + create_config_directory_with_global_ignore(content).expect("config directory"); + TestEnv { + config_dir: Some(config_dir), + ..self } } @@ -206,13 +230,8 @@ path: P, args: &[&str], ) -> process::Output { - // Setup *fd* command. - let mut cmd = process::Command::new(&self.fd_exe); - cmd.current_dir(self.temp_dir.path().join(path)); - cmd.arg("--no-global-ignore-file").args(args); - // Run *fd*. - let output = cmd.output().expect("fd output"); + let output = self.run_command(path.as_ref(), args); // Check for exit status. if !output.status.success() { @@ -288,6 +307,21 @@ self.assert_error_subdirectory(".", args, Some(expected)) } + fn run_command(&self, path: &Path, args: &[&str]) -> process::Output { + // Setup *fd* command. + let mut cmd = process::Command::new(&self.fd_exe); + cmd.current_dir(self.temp_dir.path().join(path)); + if let Some(config_dir) = &self.config_dir { + cmd.env("XDG_CONFIG_HOME", config_dir.path()); + } else { + cmd.arg("--no-global-ignore-file"); + } + cmd.args(args); + + // Run *fd*. + cmd.output().expect("fd output") + } + /// Assert that calling *fd* in the specified path under the root working directory, /// and with the specified arguments produces an error with the expected message. fn assert_error_subdirectory<P: AsRef<Path>>( @@ -296,13 +330,7 @@ args: &[&str], expected: Option<&str>, ) -> process::ExitStatus { - // Setup *fd* command. - let mut cmd = process::Command::new(&self.fd_exe); - cmd.current_dir(self.temp_dir.path().join(path)); - cmd.arg("--no-global-ignore-file").args(args); - - // Run *fd*. - let output = cmd.output().expect("fd output"); + let output = self.run_command(path.as_ref(), args); if let Some(expected) = expected { // Normalize both expected and actual output. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fd-8.6.0/tests/tests.rs new/fd-8.7.0/tests/tests.rs --- old/fd-8.6.0/tests/tests.rs 2022-12-09 07:41:24.000000000 +0100 +++ new/fd-8.7.0/tests/tests.rs 2023-02-24 08:14:46.000000000 +0100 @@ -808,6 +808,62 @@ te.assert_output(&["--no-ignore", "foo"], "inner/foo"); } +/// Don't require git to respect gitignore (--no-require-git) +#[test] +fn test_respect_ignore_files() { + let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES); + + // Not in a git repo anymore + fs::remove_dir(te.test_root().join(".git")).unwrap(); + + // don't respect gitignore because we're not in a git repo + te.assert_output( + &["foo"], + "a.foo + gitignored.foo + one/b.foo + one/two/c.foo + one/two/C.Foo2 + one/two/three/d.foo + one/two/three/directory_foo/", + ); + + // respect gitignore because we set `--no-require-git` + te.assert_output( + &["--no-require-git", "foo"], + "a.foo + one/b.foo + one/two/c.foo + one/two/C.Foo2 + one/two/three/d.foo + one/two/three/directory_foo/", + ); + + // make sure overriding works + te.assert_output( + &["--no-require-git", "--require-git", "foo"], + "a.foo + gitignored.foo + one/b.foo + one/two/c.foo + one/two/C.Foo2 + one/two/three/d.foo + one/two/three/directory_foo/", + ); + + te.assert_output( + &["--no-require-git", "--no-ignore", "foo"], + "a.foo + gitignored.foo + fdignored.foo + one/b.foo + one/two/c.foo + one/two/C.Foo2 + one/two/three/d.foo + one/two/three/directory_foo/", + ); +} + /// VCS ignored files (--no-ignore-vcs) #[test] fn test_no_ignore_vcs() { @@ -879,6 +935,47 @@ ); } +#[cfg(not(windows))] +#[test] +fn test_global_ignore() { + let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES).global_ignore_file("one"); + te.assert_output( + &[], + "a.foo + e1 e2 + symlink", + ); +} + +#[cfg(not(windows))] +#[test_case("--unrestricted", ".hidden.foo +a.foo +fdignored.foo +gitignored.foo +one/b.foo +one/two/c.foo +one/two/C.Foo2 +one/two/three/d.foo +one/two/three/directory_foo/"; "unrestricted")] +#[test_case("--no-ignore", "a.foo +fdignored.foo +gitignored.foo +one/b.foo +one/two/c.foo +one/two/C.Foo2 +one/two/three/d.foo +one/two/three/directory_foo/"; "no-ignore")] +#[test_case("--no-global-ignore-file", "a.foo +one/b.foo +one/two/c.foo +one/two/C.Foo2 +one/two/three/d.foo +one/two/three/directory_foo/"; "no-global-ignore-file")] +fn test_no_global_ignore(flag: &str, expected_output: &str) { + let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES).global_ignore_file("one"); + te.assert_output(&[flag, "foo"], expected_output); +} + /// Symlinks (--follow) #[test] fn test_follow() { @@ -1202,6 +1299,13 @@ fn test_type_executable() { use std::os::unix::fs::OpenOptionsExt; + // This test assumes the current user isn't root + // (otherwise if the executable bit is set for any level, it is executable for the current + // user) + if users::get_current_uid() == 0 { + return; + } + let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES); fs::OpenOptions::new() @@ -1701,18 +1805,26 @@ \n\ Usage: fd [OPTIONS] [pattern] [path]...\n\ \n\ - For more information try '--help'\n\ + For more information, try '--help'.\n\ ", ); te.assert_failure_with_error( &["foo", "--exec-batch", "echo", "{/}", ";", "-x", "echo"], - "error: The argument '--exec-batch <cmd>...' cannot be used with '--exec <cmd>...'", + "error: the argument '--exec-batch <cmd>...' cannot be used with '--exec <cmd>...'\n\ + \n\ + Usage: fd --exec-batch <cmd>... <pattern> [path]...\n\ + \n\ + For more information, try '--help'.\n\ + ", ); te.assert_failure_with_error( &["foo", "--exec-batch"], - "error: The argument '--exec-batch <cmd>...' requires a value but none was supplied", + "error: a value is required for '--exec-batch <cmd>...' but none was supplied\n\ + \n\ + For more information, try '--help'.\n\ + ", ); te.assert_failure_with_error( @@ -1721,7 +1833,7 @@ \n\ Usage: fd [OPTIONS] [pattern] [path]...\n\ \n\ - For more information try '--help'\n\ + For more information, try '--help'.\n\ ", ); @@ -2358,6 +2470,7 @@ #[test_case("--hidden", &["--no-hidden"] ; "hidden")] #[test_case("--no-ignore", &["--ignore"] ; "no-ignore")] #[test_case("--no-ignore-vcs", &["--ignore-vcs"] ; "no-ignore-vcs")] +#[test_case("--no-require-git", &["--require-git"] ; "no-require-git")] #[test_case("--follow", &["--no-follow"] ; "follow")] #[test_case("--absolute-path", &["--relative-path"] ; "absolute-path")] #[test_case("-u", &["--ignore", "--no-hidden"] ; "u")] ++++++ fd.obsinfo ++++++ --- /var/tmp/diff_new_pack.QdDXEf/_old 2023-02-28 12:49:16.932721151 +0100 +++ /var/tmp/diff_new_pack.QdDXEf/_new 2023-02-28 12:49:16.936721173 +0100 @@ -1,5 +1,5 @@ name: fd -version: 8.6.0 -mtime: 1670568084 -commit: d5bca085dd9f9091226bc01dc9b579979aad735f +version: 8.7.0 +mtime: 1677222886 +commit: 840a565d3aadbeb303b10a01c0aa3561924dfc46 ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/fd/vendor.tar.xz /work/SRC/openSUSE:Factory/.fd.new.31432/vendor.tar.xz differ: char 27, line 1
participants (1)
-
Source-Sync