Canonicalise paths for ignore discovery (#760)

This commit is contained in:
Félix Saparelli 2024-01-04 22:32:47 +13:00 committed by GitHub
parent 217f57f6a2
commit 4f757de8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 293 additions and 207 deletions

291
Cargo.lock generated
View File

@ -100,9 +100,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.75"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "arc-swap"
@ -137,7 +137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c"
dependencies = [
"concurrent-queue",
"event-listener 4.0.1",
"event-listener 4.0.2",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
@ -223,7 +223,7 @@ version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c"
dependencies = [
"event-listener 4.0.1",
"event-listener 4.0.2",
"event-listener-strategy",
"pin-project-lite",
]
@ -234,7 +234,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acde96f444d31031f760c5c43dc786b97d3e1cb2ee49dd06898383fe9a999758"
dependencies = [
"event-listener 4.0.1",
"event-listener 4.0.2",
]
[[package]]
@ -262,7 +262,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -302,24 +302,24 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
name = "async-task"
version = "4.6.0"
version = "4.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46"
checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
[[package]]
name = "async-trait"
version = "0.1.74"
version = "0.1.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -474,9 +474,9 @@ checksum = "e516014975db8769c0dcd1aba681c21079475fcddf77118bf54f9e2e013f6b29"
[[package]]
name = "bstr"
version = "1.8.0"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c"
checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc"
dependencies = [
"memchr",
"regex-automata 0.4.3",
@ -512,9 +512,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
[[package]]
name = "c-gull"
version = "0.15.37"
version = "0.15.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e796aa277baa42adfef2f5a3d2e5ef16db57c056587fa3974711ebe8c014347a"
checksum = "aea6f945c316611372195edc506dfabc3fbc2b0811d4bdeb5700e5739150c746"
dependencies = [
"c-scape",
"errno",
@ -525,9 +525,9 @@ dependencies = [
[[package]]
name = "c-scape"
version = "0.15.37"
version = "0.15.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "863206a04c05d9af54515a6832f302c63ce70ebcee25490aadd96c21925d1f51"
checksum = "2da8e03739ea180db9ac1c153c152f3672adf95faf474b766f28caa6ffc93985"
dependencies = [
"bitflags 2.4.1",
"errno",
@ -580,9 +580,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.4.11"
version = "4.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2"
checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d"
dependencies = [
"clap_builder",
"clap_derive",
@ -590,9 +590,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.4.11"
version = "4.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb"
checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9"
dependencies = [
"anstream",
"anstyle",
@ -603,9 +603,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "4.4.4"
version = "4.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae"
checksum = "97aeaa95557bd02f23fbb662f981670c3d20c5a26e69f7354b28f57092437fcd"
dependencies = [
"clap",
]
@ -629,7 +629,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -640,9 +640,9 @@ checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"
[[package]]
name = "clap_mangen"
version = "0.2.15"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3be86020147691e1d2ef58f75346a3d4d94807bfc473e377d52f09f0f7d77f7"
checksum = "10b5db60b3310cdb376fbeb8826e875a38080d0c61bdec0a91a3da8338948736"
dependencies = [
"clap",
"roff",
@ -769,9 +769,9 @@ dependencies = [
[[package]]
name = "crossbeam-channel"
version = "0.5.9"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5"
checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2"
dependencies = [
"cfg-if",
"crossbeam-utils",
@ -790,21 +790,20 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
version = "0.9.16"
version = "0.9.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa"
checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d"
dependencies = [
"autocfg",
"cfg-if",
"crossbeam-utils",
"memoffset 0.9.0",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.17"
version = "0.8.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f"
checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c"
dependencies = [
"cfg-if",
]
@ -837,9 +836,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]]
name = "deranged"
version = "0.3.10"
version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc"
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
dependencies = [
"powerfmt",
]
@ -976,7 +975,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -1023,9 +1022,9 @@ dependencies = [
[[package]]
name = "event-listener"
version = "4.0.1"
version = "4.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712"
checksum = "218a870470cce1469024e9fb66b901aa983929d81304a1cdb299f28118e550d5"
dependencies = [
"concurrent-queue",
"parking",
@ -1038,15 +1037,15 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3"
dependencies = [
"event-listener 4.0.1",
"event-listener 4.0.2",
"pin-project-lite",
]
[[package]]
name = "eyra"
version = "0.16.8"
version = "0.16.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a1a709c15a719374d2bfce0bd13487e045fdcc97c10d874503d48f1ac9ba8f7"
checksum = "db384ddd5420abd490da5ac8f52ab60983661315eed82d866ae4a72cdadc7e1a"
dependencies = [
"c-gull",
]
@ -1132,9 +1131,9 @@ dependencies = [
[[package]]
name = "futures"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335"
checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
dependencies = [
"futures-channel",
"futures-core",
@ -1147,9 +1146,9 @@ dependencies = [
[[package]]
name = "futures-channel"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"
checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
dependencies = [
"futures-core",
"futures-sink",
@ -1157,15 +1156,15 @@ dependencies = [
[[package]]
name = "futures-core"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"
checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
[[package]]
name = "futures-executor"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc"
checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
dependencies = [
"futures-core",
"futures-task",
@ -1174,9 +1173,9 @@ dependencies = [
[[package]]
name = "futures-io"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"
checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
[[package]]
name = "futures-lite"
@ -1208,32 +1207,32 @@ dependencies = [
[[package]]
name = "futures-macro"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"
checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
name = "futures-sink"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817"
checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
[[package]]
name = "futures-task"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2"
checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
[[package]]
name = "futures-util"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"
checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-channel",
"futures-core",
@ -1331,9 +1330,9 @@ dependencies = [
[[package]]
name = "gix-chunk"
version = "0.4.5"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d411ecd9b558b0c20b3252b7e409eec48eabc41d18324954fe526bac6e2db55f"
checksum = "003ec6deacf68076a0c157271a127e0bb2c031c1a41f7168cbe5d248d9b85c78"
dependencies = [
"thiserror",
]
@ -1375,9 +1374,9 @@ dependencies = [
[[package]]
name = "gix-config-value"
version = "0.14.1"
version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6419db582ea84dfb58c7e7b0af7fd62c808aa14954af2936a33f89b0f4ed018e"
checksum = "52e0be46f4cf1f8f9e88d0e3eb7b29718aff23889563249f379119bd1ab6910e"
dependencies = [
"bitflags 2.4.1",
"bstr",
@ -1388,9 +1387,9 @@ dependencies = [
[[package]]
name = "gix-date"
version = "0.8.1"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "468dfbe411f335f01525a1352271727f8e7772075a93fa747260f502086b30be"
checksum = "fb7f3dfb72bebe3449b5e642be64e3c6ccbe9821c8b8f19f487cf5bfbbf4067e"
dependencies = [
"bstr",
"itoa",
@ -1497,13 +1496,13 @@ dependencies = [
[[package]]
name = "gix-macros"
version = "0.1.1"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae"
checksum = "d75e7ab728059f595f6ddc1ad8771b8d6a231971ae493d9d5948ecad366ee8bb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -1566,9 +1565,9 @@ dependencies = [
[[package]]
name = "gix-path"
version = "0.10.1"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d86d6fac2fabe07b67b7835f46d07571f68b11aa1aaecae94fe722ea4ef305e1"
checksum = "b8dd0998ab245f33d40ca2267e58d542fe54185ebd1dc41923346cf28d179fb6"
dependencies = [
"bstr",
"gix-trace",
@ -1579,9 +1578,9 @@ dependencies = [
[[package]]
name = "gix-quote"
version = "0.4.8"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f84845efa535468bc79c5a87b9d29219f1da0313c8ecf0365a5daa7e72786f2"
checksum = "9f7dc10303d73a960d10fb82f81188b036ac3e6b11b5795b20b1a60b51d1321f"
dependencies = [
"bstr",
"btoi",
@ -1656,14 +1655,14 @@ dependencies = [
[[package]]
name = "gix-sec"
version = "0.10.1"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a36ea2c5907d64a9b4b5d3cc9f430e6c30f0509646b5e38eb275ca57c5bf29e2"
checksum = "78f6dce0c6683e2219e8169aac4b1c29e89540a8262fef7056b31d80d969408c"
dependencies = [
"bitflags 2.4.1",
"gix-path",
"libc",
"windows 0.48.0",
"windows 0.52.0",
]
[[package]]
@ -1681,9 +1680,9 @@ dependencies = [
[[package]]
name = "gix-trace"
version = "0.1.4"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b686a35799b53a9825575ca3f06481d0a053a409c4d97ffcf5ddd67a8760b497"
checksum = "e8e1127ede0475b58f4fe9c0aaa0d9bb0bad2af90bbd93ccd307c8632b863d89"
[[package]]
name = "gix-traverse"
@ -1717,18 +1716,18 @@ dependencies = [
[[package]]
name = "gix-utils"
version = "0.1.6"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f82c41937f00e15a1f6cb0b55307f0ca1f77f4407ff2bf440be35aa688c6a3e"
checksum = "de6225e2de30b6e9bca2d9f1cc4731640fcef0fb3cabddceee366e7e85d3e94f"
dependencies = [
"fastrand 2.0.1",
]
[[package]]
name = "gix-validate"
version = "0.8.1"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75b7d8e4274be69f284bbc7e6bb2ccf7065dbcdeba22d8c549f2451ae426883f"
checksum = "ac7cc36f496bd5d96cdca0f9289bb684480725d40db60f48194aa7723b883854"
dependencies = [
"bstr",
"thiserror",
@ -1896,16 +1895,16 @@ dependencies = [
[[package]]
name = "iana-time-zone"
version = "0.1.58"
version = "0.1.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20"
checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
"windows-core 0.52.0",
]
[[package]]
@ -1952,6 +1951,7 @@ dependencies = [
"gix-config",
"ignore",
"miette",
"normalize-path",
"project-origins",
"radix_trie",
"thiserror",
@ -2022,13 +2022,13 @@ dependencies = [
[[package]]
name = "is-terminal"
version = "0.4.9"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"
dependencies = [
"hermit-abi",
"rustix 0.38.28",
"windows-sys 0.48.0",
"windows-sys 0.52.0",
]
[[package]]
@ -2205,9 +2205,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "memchr"
version = "2.6.4"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "memmap2"
@ -2274,7 +2274,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -2485,9 +2485,9 @@ dependencies = [
[[package]]
name = "object"
version = "0.32.1"
version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
@ -2516,9 +2516,9 @@ dependencies = [
[[package]]
name = "origin"
version = "0.16.4"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7d9b3f29defd1880770d2ab032f0ed0f216e51bc4e509d164c1a63d3bd09dfd"
checksum = "29694778a0a2a6fa799f26926fd5537c120636f317b69dbfc4e6414dfc71ec99"
dependencies = [
"bitflags 2.4.1",
"env_logger",
@ -2653,7 +2653,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -2751,9 +2751,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.70"
version = "1.0.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708"
dependencies = [
"unicode-ident",
]
@ -2795,7 +2795,7 @@ dependencies = [
"itertools 0.11.0",
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -2818,9 +2818,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.33"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@ -3001,9 +3001,9 @@ dependencies = [
[[package]]
name = "rustix-dlmalloc"
version = "0.1.1"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0af789be2f2a6a302aedb487019503fd5b51af4cac7b30ed2590d16d05a0a2ea"
checksum = "a0fab868d3bd1ac5de1f1507e58fab624339e5bb201049e3329767974ba219ec"
dependencies = [
"rustix 0.38.28",
"rustix-futex-sync",
@ -3059,35 +3059,35 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "semver"
version = "1.0.20"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
[[package]]
name = "serde"
version = "1.0.193"
version = "1.0.194"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.193"
version = "1.0.194"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
name = "serde_json"
version = "1.0.108"
version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
dependencies = [
"itoa",
"ryu",
@ -3096,13 +3096,13 @@ dependencies = [
[[package]]
name = "serde_repr"
version = "0.1.17"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145"
checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -3161,9 +3161,9 @@ dependencies = [
[[package]]
name = "similar"
version = "2.3.0"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597"
checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21"
[[package]]
name = "siphasher"
@ -3287,9 +3287,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.41"
version = "2.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269"
checksum = "1726efe18f42ae774cc644f330953a5e7b3c3003d3edcecf18850fe9d4dd9afb"
dependencies = [
"proc-macro2",
"quote",
@ -3314,15 +3314,15 @@ dependencies = [
[[package]]
name = "tempfile"
version = "3.8.1"
version = "3.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
dependencies = [
"cfg-if",
"fastrand 2.0.1",
"redox_syscall",
"rustix 0.38.28",
"windows-sys 0.48.0",
"windows-sys 0.52.0",
]
[[package]]
@ -3380,22 +3380,22 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.51"
version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7"
checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.51"
version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df"
checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -3491,7 +3491,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -3643,7 +3643,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
]
[[package]]
@ -3952,7 +3952,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
"wasm-bindgen-shared",
]
@ -3974,7 +3974,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.41",
"syn 2.0.47",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -4087,6 +4087,7 @@ dependencies = [
"dunce",
"ignore",
"ignore-files",
"normalize-path",
"project-origins",
"tokio",
"tracing",
@ -4201,21 +4202,22 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.48.0"
version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
dependencies = [
"windows-core 0.51.1",
"windows-targets 0.48.5",
]
[[package]]
name = "windows"
version = "0.51.1"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-targets 0.48.5",
"windows-core 0.52.0",
"windows-targets 0.52.0",
]
[[package]]
@ -4227,6 +4229,15 @@ dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
]
[[package]]
name = "windows-sys"
version = "0.48.0"
@ -4361,9 +4372,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
[[package]]
name = "winnow"
version = "0.5.30"
version = "0.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5"
checksum = "8434aeec7b290e8da5c3f0d628cb0eac6cabcb31d14bb74f779a08109a5914d6"
dependencies = [
"memchr",
]

View File

@ -167,4 +167,8 @@ _watchexec() {
esac
}
complete -F _watchexec -o nosort -o bashdefault -o default watchexec
if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
complete -F _watchexec -o nosort -o bashdefault -o default watchexec
else
complete -F _watchexec -o bashdefault -o default watchexec
fi

View File

@ -1,4 +1,5 @@
use std::{
borrow::Cow,
collections::HashSet,
env,
path::{Path, PathBuf},
@ -102,42 +103,33 @@ pub async fn ignores(
vcs_types: &[ProjectType],
origin: &Path,
) -> Result<Vec<IgnoreFile>> {
fn higher_make_absolute_if_needed<'a>(
origin: &'a Path,
) -> impl 'a + Fn(&'a PathBuf) -> Cow<'a, Path> {
|path| {
if path.is_absolute() {
Cow::Borrowed(path)
} else {
Cow::Owned(origin.join(path))
}
}
}
let mut skip_git_global_excludes = false;
let mut ignores = if args.no_project_ignore {
Vec::new()
} else {
// Build list of absolute explicitly included paths
let include_paths = args
.paths
.iter()
.map(|p| {
if p.is_absolute() {
p.clone()
} else {
origin.join(p)
}
})
.collect();
let make_absolute_if_needed = higher_make_absolute_if_needed(origin);
let include_paths = args.paths.iter().map(&make_absolute_if_needed);
let ignore_files = args.ignore_files.iter().map(&make_absolute_if_needed);
// Build list of absolute explicitly ignored paths
let ignore_files = args
.ignore_files
.iter()
.map(|p| {
if p.is_absolute() {
p.clone()
} else {
origin.join(p)
}
})
.collect();
let (mut ignores, errors) = ignore_files::from_origin(IgnoreFilesFromOriginArgs::new(
origin,
include_paths,
ignore_files,
)?)
let (mut ignores, errors) = ignore_files::from_origin(
IgnoreFilesFromOriginArgs::new_unchecked(origin, include_paths, ignore_files)
.canonicalise()
.await
.into_diagnostic()?,
)
.await;
for err in errors {

View File

@ -2,6 +2,8 @@
## Next (YYYY-MM-DD)
- Normalise paths on all platforms (via `normalize-path`).
## v3.0.0 (2024-01-01)
- Deps: `ignore-files` 2.0.0

View File

@ -17,8 +17,9 @@ edition = "2021"
[dependencies]
ignore = "0.4.18"
tracing = "0.1.40"
dunce = "1.0.4"
normalize-path = "0.2.1"
tracing = "0.1.40"
[dependencies.ignore-files]
version = "2.0.0"

View File

@ -13,6 +13,7 @@
use ignore::Match;
use ignore_files::IgnoreFilter;
use normalize_path::NormalizePath;
use tracing::{trace, trace_span};
use watchexec::{error::RuntimeError, filter::Filterer};
use watchexec_events::{Event, FileType, Priority};
@ -31,7 +32,8 @@ impl Filterer for IgnoreFilterer {
let mut pass = true;
for (path, file_type) in event.paths() {
let path = dunce::simplified(path);
let path = dunce::simplified(path).normalize();
let path = path.as_path();
let _span = trace_span!("checking_against_compiled", ?path, ?file_type).entered();
let is_dir = file_type.map_or(false, |t| matches!(t, FileType::Dir));

View File

@ -2,10 +2,14 @@
## Next (YYYY-MM-DD)
- Normalise paths on all platforms (via `normalize-path`).
- Require paths be normalised before discovery.
- Add convenience APIs to `IgnoreFilesFromOriginArgs` for that purpose.
## v2.0.0 (2024-01-01)
- A round of optimisation by @t3hmrman, improving directory traversal to avoid crawling unneeded paths ([#663](https://github.com/watchexec/watchexec/pull/663))
- Respect `applies_in` scope when processing nested ignores, by @thislooksfun ([#746](https://github.com/watchexec/watchexec/pull/746))
- A round of optimisation by @t3hmrman, improving directory traversal to avoid crawling unneeded paths. ([#663](https://github.com/watchexec/watchexec/pull/663))
- Respect `applies_in` scope when processing nested ignores, by @thislooksfun. ([#746](https://github.com/watchexec/watchexec/pull/746))
## v1.3.2 (2023-11-26)

View File

@ -19,6 +19,7 @@ futures = "0.3.29"
gix-config = "0.31.0"
ignore = "0.4.18"
miette = "5.3.0"
normalize-path = "0.2.1"
thiserror = "1.0.50"
tracing = "0.1.40"
radix_trie = "0.2.1"

View File

@ -5,8 +5,10 @@ use std::{
path::{Path, PathBuf},
};
use futures::future::try_join_all;
use gix_config::{path::interpolate::Context as InterpolateContext, File, Path as GitPath};
use miette::{bail, Result};
use normalize_path::NormalizePath;
use project_origins::ProjectType;
use tokio::fs::{canonicalize, metadata, read_dir};
use tracing::{trace, trace_span};
@ -14,42 +16,97 @@ use tracing::{trace, trace_span};
use crate::{IgnoreFile, IgnoreFilter};
/// Arguments for finding ignored files in a given directory and subdirectories
#[derive(Clone, Debug, Default, PartialEq, Eq)]
#[non_exhaustive]
pub struct IgnoreFilesFromOriginArgs {
/// Origin from which finding ignored files will start
origin: PathBuf,
/// Origin from which finding ignored files will start.
pub origin: PathBuf,
/// Paths that have been explicitly selected to be watched.
///
/// If this list is non-empty, all paths not on this list will be ignored
/// If this list is non-empty, all paths not on this list will be ignored.
///
/// These paths *must* be absolute, and are checked upon creation
explicit_watches: Vec<PathBuf>,
/// These paths *must* be absolute and normalised (no `.` and `..` components).
pub explicit_watches: Vec<PathBuf>,
/// Paths that have been explicitly ignored
/// Paths that have been explicitly ignored.
///
/// If this list is non-empty, all paths on this list will be ignored
/// If this list is non-empty, all paths on this list will be ignored.
///
/// These paths *must* be absolute
explicit_ignores: Vec<PathBuf>,
/// These paths *must* be absolute and normalised (no `.` and `..` components).
pub explicit_ignores: Vec<PathBuf>,
}
impl IgnoreFilesFromOriginArgs {
/// Check that this struct is correctly-formed.
pub fn check(&self) -> Result<()> {
if self.explicit_watches.iter().any(|p| !p.is_absolute()) {
bail!("explicit_watches contains non-absolute paths");
}
if self.explicit_watches.iter().any(|p| !p.is_normalized()) {
bail!("explicit_watches contains non-normalised paths");
}
if self.explicit_ignores.iter().any(|p| !p.is_absolute()) {
bail!("explicit_ignores contains non-absolute paths");
}
if self.explicit_ignores.iter().any(|p| !p.is_normalized()) {
bail!("explicit_ignores contains non-normalised paths");
}
Ok(())
}
/// Canonicalise all paths.
///
/// The result is always well-formed.
pub async fn canonicalise(self) -> std::io::Result<Self> {
Ok(Self {
origin: canonicalize(&self.origin).await?,
explicit_watches: try_join_all(self.explicit_watches.into_iter().map(canonicalize))
.await?,
explicit_ignores: try_join_all(self.explicit_ignores.into_iter().map(canonicalize))
.await?,
})
}
/// Create args with all fields set and check that they are correctly-formed.
pub fn new(
origin: impl AsRef<Path>,
explicit_watches: Vec<PathBuf>,
explicit_ignores: Vec<PathBuf>,
) -> Result<Self> {
if explicit_watches.iter().any(|p| !p.is_absolute()) {
bail!("explicit watch dir contains non-absolute directories");
}
if explicit_ignores.iter().any(|p| !p.is_absolute()) {
bail!("explicit watch dir contains non-absolute directories");
}
Ok(Self {
let this = Self {
origin: PathBuf::from(origin.as_ref()),
explicit_watches,
explicit_ignores,
})
};
this.check()?;
Ok(this)
}
/// Create args without checking well-formed-ness.
///
/// Use this only if you know that the args are well-formed, or if you are about to call
/// [`canonicalise()`][IgnoreFilesFromOriginArgs::canonicalise()] on them.
pub fn new_unchecked(
origin: impl AsRef<Path>,
explicit_watches: impl IntoIterator<Item = impl Into<PathBuf>>,
explicit_ignores: impl IntoIterator<Item = impl Into<PathBuf>>,
) -> Self {
Self {
origin: origin.as_ref().into(),
explicit_watches: explicit_watches.into_iter().map(Into::into).collect(),
explicit_ignores: explicit_ignores.into_iter().map(Into::into).collect(),
}
}
}
impl From<&Path> for IgnoreFilesFromOriginArgs {
fn from(path: &Path) -> Self {
Self {
origin: path.into(),
..Default::default()
}
}
}
@ -83,11 +140,19 @@ impl IgnoreFilesFromOriginArgs {
/// ## Async
///
/// This future is not `Send` due to [`gix_config`] internals.
///
/// ## Panics
///
/// This function panics if the `args` are not correctly-formed; this can be checked beforehand
/// without panicking with [`IgnoreFilesFromOriginArgs::check()`].
#[allow(clippy::future_not_send)]
pub async fn from_origin(
args: impl Into<IgnoreFilesFromOriginArgs>,
) -> (Vec<IgnoreFile>, Vec<Error>) {
let args = args.into();
args.check()
.expect("checking well-formedness of IgnoreFilesFromOriginArgs");
let origin = &args.origin;
let mut ignore_files = args
.explicit_ignores
@ -455,10 +520,7 @@ impl DirTourist {
to_visit: vec![base.clone()],
base,
to_skip: HashSet::new(),
to_explicitly_watch: watch_files.iter().fold(HashSet::new(), |mut acc, path| {
acc.insert(path.clone());
acc
}),
to_explicitly_watch: watch_files.iter().cloned().collect(),
errors: Vec::new(),
filter,
})

View File

@ -9,7 +9,7 @@ use radix_trie::{Trie, TrieCommon};
use tokio::fs::{canonicalize, read_to_string};
use tracing::{trace, trace_span};
use crate::{Error, IgnoreFile};
use crate::{simplify_path, Error, IgnoreFile};
#[derive(Clone, Debug)]
struct Ignore {
@ -60,7 +60,7 @@ impl IgnoreFilter {
.await
.map_err(move |err| Error::Canonicalize { path: origin, err })?;
let origin = dunce::simplified(&origin);
let origin = simplify_path(&origin);
let _span = trace_span!("build_filterer", ?origin);
trace!(files=%files.len(), "loading file contents");
@ -100,10 +100,10 @@ impl IgnoreFilter {
// add builder for the root of the file system, so that we can handle global ignores and globs
ignores_trie.insert(
prefix(origin),
prefix(&origin),
Ignore {
gitignore: Gitignore::empty(),
builder: Some(GitignoreBuilder::new(origin)),
builder: Some(GitignoreBuilder::new(&origin)),
},
);
@ -113,7 +113,7 @@ impl IgnoreFilter {
for (file, content) in files_contents.into_iter().flatten() {
let _span = trace_span!("loading ignore file", ?file).entered();
let applies_in = get_applies_in_path(origin, &file);
let applies_in = get_applies_in_path(&origin, &file);
let mut builder = ignores_trie
.get(&applies_in.display().to_string())
@ -306,7 +306,8 @@ impl IgnoreFilter {
/// Match a particular path against the ignore set.
pub fn match_path(&self, path: &Path, is_dir: bool) -> Match<&Glob> {
let path = dunce::simplified(path);
let path = simplify_path(path);
let path = path.as_path();
let mut search_path = path;
loop {
@ -388,7 +389,7 @@ fn get_applies_in_path(origin: &Path, ignore_file: &IgnoreFile) -> PathBuf {
ignore_file
.applies_in
.as_ref()
.map_or(root_path, |p| PathBuf::from(dunce::simplified(p)))
.map_or(root_path, |p| simplify_path(p))
}
/// Gets the root component of a given path.

View File

@ -6,8 +6,9 @@
//! more ignore files in _these_ subfolders, and so on. Discovering and interpreting all of these in
//! a single context is not a simple task: this is what this crate provides.
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use normalize_path::NormalizePath;
use project_origins::ProjectType;
#[doc(inline)]
@ -37,3 +38,7 @@ pub struct IgnoreFile {
/// Which project type the ignore file applies to, or was found through.
pub applies_to: Option<ProjectType>,
}
pub(crate) fn simplify_path(path: &Path) -> PathBuf {
dunce::simplified(path).normalize()
}

View File

@ -98,7 +98,7 @@ impl Handler {
/// Get a job given its Id.
///
/// This returns a job handle, if it existed when this handler was called.
#[must_use]
#[must_use]
pub fn get_job(&self, id: Id) -> Option<Job> {
self.extant.get(&id).cloned()
}

View File

@ -159,7 +159,8 @@ impl Watchexec {
signal::worker(config.clone(), er_s.clone(), ev_s.clone()).map_ok(|()| "signal"),
);
tasks.spawn(
keyboard::worker(config.clone(), er_s.clone(), ev_s.clone()).map_ok(|()| "keyboard"),
keyboard::worker(config.clone(), er_s.clone(), ev_s.clone())
.map_ok(|()| "keyboard"),
);
tasks.spawn(error_hook(er_r, config.error_handler.clone()).map_ok(|()| "error"));

View File

@ -29,7 +29,7 @@ impl Shell {
}
#[cfg(windows)]
#[must_use]
#[must_use]
/// Shorthand for the CMD.EXE shell.
pub fn cmd() -> Self {
Self {