From 067d37aa3c6fc22f8da33e1b53d8a02b7624c82e Mon Sep 17 00:00:00 2001 From: Matt Kulukundis Date: Tue, 25 Jun 2024 12:00:51 -0400 Subject: [PATCH] copy-tracking: cargo add gix-format and gix diff-blob feature --- Cargo.lock | 205 ++++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 + cli/Cargo.toml | 1 + lib/Cargo.toml | 3 +- lib/testutils/Cargo.toml | 1 + 5 files changed, 207 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6676fae07..27d9037f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,6 +24,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -654,6 +655,19 @@ dependencies = [ "typenum", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "deranged" version = "0.3.11" @@ -731,6 +745,15 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -964,16 +987,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "984c5018adfa7a4536ade67990b3ebc6e11ab57b3d6cd9968de0947ca99b4b06" dependencies = [ "gix-actor", + "gix-attributes", + "gix-command", "gix-commitgraph", "gix-config", "gix-date", "gix-diff", "gix-discover", "gix-features", + "gix-filter", "gix-fs", "gix-glob", "gix-hash", "gix-hashtable", + "gix-ignore", "gix-index", "gix-lock", "gix-macros", @@ -981,17 +1008,20 @@ dependencies = [ "gix-odb", "gix-pack", "gix-path", + "gix-pathspec", "gix-ref", "gix-refspec", "gix-revision", "gix-revwalk", "gix-sec", + "gix-submodule", "gix-tempfile", "gix-trace", "gix-traverse", "gix-url", "gix-utils", "gix-validate", + "gix-worktree", "once_cell", "parking_lot", "smallvec", @@ -1012,6 +1042,23 @@ dependencies = [ "winnow 0.6.13", ] +[[package]] +name = "gix-attributes" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eefb48f42eac136a4a0023f49a54ec31be1c7a9589ed762c45dcb9b953f7ecc8" +dependencies = [ + "bstr", + "gix-glob", + "gix-path", + "gix-quote", + "gix-trace", + "kstring", + "smallvec", + "thiserror", + "unicode-bom", +] + [[package]] name = "gix-bitmap" version = "0.2.11" @@ -1030,6 +1077,18 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-command" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c22e086314095c43ffe5cdc5c0922d5439da4fd726f3b0438c56147c34dc225" +dependencies = [ + "bstr", + "gix-path", + "gix-trace", + "shell-words", +] + [[package]] name = "gix-commitgraph" version = "0.24.2" @@ -1097,8 +1156,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40b9bd8b2d07b6675a840b56a6c177d322d45fa082672b0dad8f063b25baf0a4" dependencies = [ "bstr", + "gix-command", + "gix-filter", + "gix-fs", "gix-hash", "gix-object", + "gix-path", + "gix-tempfile", + "gix-trace", + "gix-worktree", + "imara-diff", "thiserror", ] @@ -1140,6 +1207,27 @@ dependencies = [ "walkdir", ] +[[package]] +name = "gix-filter" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00ce6ea5ac8fca7adbc63c48a1b9e0492c222c386aa15f513405f1003f2f4ab2" +dependencies = [ + "bstr", + "encoding_rs", + "gix-attributes", + "gix-command", + "gix-hash", + "gix-object", + "gix-packetline-blocking", + "gix-path", + "gix-quote", + "gix-trace", + "gix-utils", + "smallvec", + "thiserror", +] + [[package]] name = "gix-fs" version = "0.11.1" @@ -1180,10 +1268,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" dependencies = [ "gix-hash", - "hashbrown", + "hashbrown 0.14.5", "parking_lot", ] +[[package]] +name = "gix-ignore" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "640dbeb4f5829f9fc14d31f654a34a0350e43a24e32d551ad130d99bf01f63f1" +dependencies = [ + "bstr", + "gix-glob", + "gix-path", + "gix-trace", + "unicode-bom", +] + [[package]] name = "gix-index" version = "0.33.0" @@ -1203,7 +1304,7 @@ dependencies = [ "gix-traverse", "gix-utils", "gix-validate", - "hashbrown", + "hashbrown 0.14.5", "itoa", "libc", "memmap2", @@ -1294,6 +1395,18 @@ dependencies = [ "uluru", ] +[[package]] +name = "gix-packetline-blocking" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31d42378a3d284732e4d589979930d0d253360eccf7ec7a80332e5ccb77e14a" +dependencies = [ + "bstr", + "faster-hex", + "gix-trace", + "thiserror", +] + [[package]] name = "gix-path" version = "0.10.7" @@ -1307,6 +1420,21 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-pathspec" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76cab098dc10ba2d89f634f66bf196dea4d7db4bf10b75c7a9c201c55a2ee19" +dependencies = [ + "bitflags 2.5.0", + "bstr", + "gix-attributes", + "gix-config-value", + "gix-glob", + "gix-path", + "thiserror", +] + [[package]] name = "gix-quote" version = "0.4.12" @@ -1397,12 +1525,28 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "gix-submodule" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "921cd49924ac14b6611b22e5fb7bbba74d8780dc7ad26153304b64d1272460ac" +dependencies = [ + "bstr", + "gix-config", + "gix-path", + "gix-pathspec", + "gix-refspec", + "gix-url", + "thiserror", +] + [[package]] name = "gix-tempfile" version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3b0e276cd08eb2a22e9f286a4f13a222a01be2defafa8621367515375644b99" dependencies = [ + "dashmap", "gix-fs", "libc", "once_cell", @@ -1467,6 +1611,25 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-worktree" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53f6b7de83839274022aff92157d7505f23debf739d257984a300a35972ca94e" +dependencies = [ + "bstr", + "gix-attributes", + "gix-features", + "gix-fs", + "gix-glob", + "gix-hash", + "gix-ignore", + "gix-index", + "gix-object", + "gix-path", + "gix-validate", +] + [[package]] name = "glob" version = "0.3.1" @@ -1496,6 +1659,12 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.5" @@ -1582,6 +1751,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "imara-diff" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" +dependencies = [ + "ahash", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.2.6" @@ -1589,7 +1768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -1684,6 +1863,7 @@ dependencies = [ "futures 0.3.30", "git2", "gix", + "gix-filter", "hex", "indexmap", "indoc", @@ -1736,6 +1916,7 @@ dependencies = [ "futures 0.3.30", "git2", "gix", + "gix-filter", "glob", "hex", "ignore", @@ -1811,6 +1992,15 @@ dependencies = [ "rayon", ] +[[package]] +name = "kstring" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" +dependencies = [ + "static_assertions", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1907,7 +2097,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -2741,6 +2931,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "signal-hook" version = "0.3.17" @@ -2936,6 +3132,7 @@ version = "0.19.0" dependencies = [ "async-trait", "config", + "futures 0.3.30", "git2", "hex", "itertools 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index 04d821208..52e9d1ab3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,9 @@ git2 = "0.18.3" gix = { version = "0.63.0", default-features = false, features = [ "index", "max-performance-safe", + "blob-diff", ] } +gix-filter = "0.11.2" glob = "0.3.1" hex = "0.4.3" ignore = "0.4.20" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index fd1085b8b..0c0cd1ddd 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -65,6 +65,7 @@ esl01-renderdag = { workspace = true } futures = { workspace = true } git2 = { workspace = true } gix = { workspace = true } +gix-filter = { workspace = true } hex = { workspace = true } indexmap = { workspace = true } itertools = { workspace = true } diff --git a/lib/Cargo.toml b/lib/Cargo.toml index e6a47dede..a577d1d17 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -44,6 +44,7 @@ either = { workspace = true } futures = { workspace = true } git2 = { workspace = true, optional = true } gix = { workspace = true, optional = true } +gix-filter = { workspace = true, optional = true } glob = { workspace = true } hex = { workspace = true } ignore = { workspace = true } @@ -92,7 +93,7 @@ tokio = { workspace = true, features = ["full"] } [features] default = ["git"] -git = ["dep:git2", "dep:gix"] +git = ["dep:git2", "dep:gix", "dep:gix-filter"] vendored-openssl = ["git2/vendored-openssl"] watchman = ["dep:tokio", "dep:watchman_client"] testing = ["git"] diff --git a/lib/testutils/Cargo.toml b/lib/testutils/Cargo.toml index 640806e97..e827c9611 100644 --- a/lib/testutils/Cargo.toml +++ b/lib/testutils/Cargo.toml @@ -17,6 +17,7 @@ readme = { workspace = true } [dependencies] async-trait = { workspace = true } config = { workspace = true } +futures = { workspace = true } git2 = { workspace = true } hex = { workspace = true } itertools = { workspace = true }