diff --git a/Cargo.lock b/Cargo.lock index fd5011c4..06f5cb2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,19 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy 0.7.35", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -52,11 +65,17 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -69,33 +88,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -116,11 +135,23 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arc-swap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "async-compression" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" +checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" dependencies = [ "brotli", "flate2", @@ -130,6 +161,12 @@ dependencies = [ "tokio", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.3.0" @@ -205,6 +242,17 @@ dependencies = [ "alloc-stdlib", ] +[[package]] +name = "bstr" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -219,9 +267,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "bytesize" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" [[package]] name = "bzip2" @@ -246,9 +300,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" dependencies = [ "jobserver", "libc", @@ -272,9 +326,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.9" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" +checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" dependencies = [ "clap_builder", "clap_derive", @@ -282,9 +336,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.9" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" +checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" dependencies = [ "anstream", "anstyle", @@ -294,21 +348,27 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "clru" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "color-eyre" @@ -339,9 +399,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "constant_time_eq" @@ -407,6 +467,19 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -435,6 +508,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -462,6 +544,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "dashmap" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "deflate64" version = "0.1.9" @@ -485,7 +581,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -528,7 +624,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -543,6 +639,28 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[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 = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -569,6 +687,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "faster-hex" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" + [[package]] name = "fastrand" version = "2.1.0" @@ -583,7 +707,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -731,17 +855,856 @@ dependencies = [ "url", ] -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - +[[package]] +name = "gix" +version = "0.64.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "gix-actor", + "gix-archive", + "gix-attributes", + "gix-command", + "gix-commitgraph", + "gix-config", + "gix-credentials", + "gix-date", + "gix-diff", + "gix-dir", + "gix-discover", + "gix-features", + "gix-filter", + "gix-fs", + "gix-glob", + "gix-hash", + "gix-hashtable", + "gix-ignore", + "gix-index", + "gix-lock", + "gix-macros", + "gix-mailmap", + "gix-negotiate", + "gix-object", + "gix-odb", + "gix-pack", + "gix-path", + "gix-pathspec", + "gix-prompt", + "gix-protocol", + "gix-ref", + "gix-refspec", + "gix-revision", + "gix-revwalk", + "gix-sec", + "gix-status", + "gix-submodule", + "gix-tempfile", + "gix-trace", + "gix-transport", + "gix-traverse", + "gix-url", + "gix-utils", + "gix-validate", + "gix-worktree", + "gix-worktree-state", + "gix-worktree-stream", + "once_cell", + "parking_lot", + "prodash", + "regex", + "signal-hook", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-actor" +version = "0.31.5" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-date", + "gix-utils", + "itoa", + "thiserror", + "winnow", +] + +[[package]] +name = "gix-archive" +version = "0.13.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-date", + "gix-object", + "gix-worktree-stream", + "jiff", + "thiserror", +] + +[[package]] +name = "gix-attributes" +version = "0.22.3" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-glob", + "gix-path", + "gix-quote", + "gix-trace", + "kstring", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-bitmap" +version = "0.2.11" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-chunk" +version = "0.4.8" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-command" +version = "0.3.8" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-path", + "gix-trace", + "shell-words", +] + +[[package]] +name = "gix-commitgraph" +version = "0.24.3" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-chunk", + "gix-features", + "gix-hash", + "memmap2", + "thiserror", +] + +[[package]] +name = "gix-config" +version = "0.38.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-config-value", + "gix-features", + "gix-glob", + "gix-path", + "gix-ref", + "gix-sec", + "memchr", + "once_cell", + "smallvec", + "thiserror", + "unicode-bom", + "winnow", +] + +[[package]] +name = "gix-config-value" +version = "0.14.7" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bitflags 2.6.0", + "bstr", + "gix-path", + "libc", + "thiserror", +] + +[[package]] +name = "gix-credentials" +version = "0.24.4" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-command", + "gix-config-value", + "gix-path", + "gix-prompt", + "gix-sec", + "gix-trace", + "gix-url", + "thiserror", +] + +[[package]] +name = "gix-date" +version = "0.9.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "itoa", + "jiff", + "thiserror", +] + +[[package]] +name = "gix-diff" +version = "0.44.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-command", + "gix-filter", + "gix-fs", + "gix-hash", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-trace", + "gix-worktree", + "imara-diff", + "thiserror", +] + +[[package]] +name = "gix-dir" +version = "0.6.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-discover", + "gix-fs", + "gix-ignore", + "gix-index", + "gix-object", + "gix-path", + "gix-pathspec", + "gix-trace", + "gix-utils", + "gix-worktree", + "thiserror", +] + +[[package]] +name = "gix-discover" +version = "0.33.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "dunce", + "gix-fs", + "gix-hash", + "gix-path", + "gix-ref", + "gix-sec", + "thiserror", +] + +[[package]] +name = "gix-features" +version = "0.38.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bytes", + "bytesize", + "crc32fast", + "crossbeam-channel", + "flate2", + "gix-hash", + "gix-trace", + "gix-utils", + "jwalk", + "libc", + "once_cell", + "parking_lot", + "prodash", + "sha1_smol", + "thiserror", + "walkdir", +] + +[[package]] +name = "gix-filter" +version = "0.11.3" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +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.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "fastrand", + "gix-features", + "gix-utils", +] + +[[package]] +name = "gix-glob" +version = "0.16.4" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bitflags 2.6.0", + "bstr", + "gix-features", + "gix-path", +] + +[[package]] +name = "gix-hash" +version = "0.14.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "faster-hex", + "thiserror", +] + +[[package]] +name = "gix-hashtable" +version = "0.5.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "gix-hash", + "hashbrown", + "parking_lot", +] + +[[package]] +name = "gix-ignore" +version = "0.11.3" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-glob", + "gix-path", + "gix-trace", + "unicode-bom", +] + +[[package]] +name = "gix-index" +version = "0.33.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bitflags 2.6.0", + "bstr", + "filetime", + "fnv", + "gix-bitmap", + "gix-features", + "gix-fs", + "gix-hash", + "gix-lock", + "gix-object", + "gix-traverse", + "gix-utils", + "gix-validate", + "hashbrown", + "itoa", + "libc", + "memmap2", + "rustix", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-lock" +version = "14.0.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "gix-tempfile", + "gix-utils", + "thiserror", +] + +[[package]] +name = "gix-macros" +version = "0.1.5" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "gix-mailmap" +version = "0.23.5" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-actor", + "gix-date", + "thiserror", +] + +[[package]] +name = "gix-negotiate" +version = "0.13.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bitflags 2.6.0", + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-object", + "gix-revwalk", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-object" +version = "0.42.3" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-actor", + "gix-date", + "gix-features", + "gix-hash", + "gix-utils", + "gix-validate", + "itoa", + "smallvec", + "thiserror", + "winnow", +] + +[[package]] +name = "gix-odb" +version = "0.61.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "arc-swap", + "gix-date", + "gix-features", + "gix-fs", + "gix-hash", + "gix-object", + "gix-pack", + "gix-path", + "gix-quote", + "parking_lot", + "tempfile", + "thiserror", +] + +[[package]] +name = "gix-pack" +version = "0.51.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "clru", + "gix-chunk", + "gix-features", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-path", + "gix-tempfile", + "memmap2", + "parking_lot", + "smallvec", + "thiserror", + "uluru", +] + +[[package]] +name = "gix-packetline" +version = "0.17.5" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "faster-hex", + "gix-trace", + "thiserror", +] + +[[package]] +name = "gix-packetline-blocking" +version = "0.17.4" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "faster-hex", + "gix-trace", + "thiserror", +] + +[[package]] +name = "gix-path" +version = "0.10.9" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-trace", + "home", + "once_cell", + "thiserror", +] + +[[package]] +name = "gix-pathspec" +version = "0.7.6" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bitflags 2.6.0", + "bstr", + "gix-attributes", + "gix-config-value", + "gix-glob", + "gix-path", + "thiserror", +] + +[[package]] +name = "gix-prompt" +version = "0.8.6" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "gix-command", + "gix-config-value", + "parking_lot", + "rustix", + "thiserror", +] + +[[package]] +name = "gix-protocol" +version = "0.45.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-credentials", + "gix-date", + "gix-features", + "gix-hash", + "gix-transport", + "gix-utils", + "maybe-async", + "thiserror", + "winnow", +] + +[[package]] +name = "gix-quote" +version = "0.4.12" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-utils", + "thiserror", +] + +[[package]] +name = "gix-ref" +version = "0.45.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "gix-actor", + "gix-features", + "gix-fs", + "gix-hash", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-utils", + "gix-validate", + "memmap2", + "thiserror", + "winnow", +] + +[[package]] +name = "gix-refspec" +version = "0.23.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-hash", + "gix-revision", + "gix-validate", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-revision" +version = "0.27.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-revwalk", + "gix-trace", + "thiserror", +] + +[[package]] +name = "gix-revwalk" +version = "0.13.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-sec" +version = "0.10.7" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bitflags 2.6.0", + "gix-path", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "gix-status" +version = "0.11.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "filetime", + "gix-diff", + "gix-dir", + "gix-features", + "gix-filter", + "gix-fs", + "gix-hash", + "gix-index", + "gix-object", + "gix-path", + "gix-pathspec", + "gix-worktree", + "portable-atomic", + "thiserror", +] + +[[package]] +name = "gix-submodule" +version = "0.12.0" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-config", + "gix-path", + "gix-pathspec", + "gix-refspec", + "gix-url", + "thiserror", +] + +[[package]] +name = "gix-tempfile" +version = "14.0.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "dashmap", + "gix-fs", + "libc", + "once_cell", + "parking_lot", + "signal-hook", + "signal-hook-registry", + "tempfile", +] + +[[package]] +name = "gix-trace" +version = "0.1.9" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" + +[[package]] +name = "gix-transport" +version = "0.42.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "base64", + "bstr", + "gix-command", + "gix-credentials", + "gix-features", + "gix-packetline", + "gix-quote", + "gix-sec", + "gix-url", + "reqwest", + "thiserror", +] + +[[package]] +name = "gix-traverse" +version = "0.39.2" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bitflags 2.6.0", + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-revwalk", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-url" +version = "0.27.4" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-features", + "gix-path", + "home", + "thiserror", + "url", +] + +[[package]] +name = "gix-utils" +version = "0.1.12" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "fastrand", + "unicode-normalization", +] + +[[package]] +name = "gix-validate" +version = "0.8.5" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "thiserror", +] + +[[package]] +name = "gix-worktree" +version = "0.34.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-attributes", + "gix-features", + "gix-fs", + "gix-glob", + "gix-hash", + "gix-ignore", + "gix-index", + "gix-object", + "gix-path", + "gix-validate", +] + +[[package]] +name = "gix-worktree-state" +version = "0.11.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "bstr", + "gix-features", + "gix-filter", + "gix-fs", + "gix-glob", + "gix-hash", + "gix-index", + "gix-object", + "gix-path", + "gix-worktree", + "io-close", + "thiserror", +] + +[[package]] +name = "gix-worktree-stream" +version = "0.13.1" +source = "git+https://github.com/Fernthedev/gitoxide.git?branch=feat/checkout-with-ref-name#e56f2c51290a4a62adecd41137991b054b727b84" +dependencies = [ + "gix-attributes", + "gix-features", + "gix-filter", + "gix-fs", + "gix-hash", + "gix-object", + "gix-path", + "gix-traverse", + "parking_lot", + "thiserror", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heck" @@ -749,6 +1712,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hmac" version = "0.12.1" @@ -758,6 +1727,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "1.1.0" @@ -798,6 +1776,12 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +[[package]] +name = "human_format" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" + [[package]] name = "humantime" version = "2.1.0" @@ -823,6 +1807,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", + "h2", "http", "http-body", "httparse", @@ -897,6 +1882,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "imara-diff" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc9da1a252bd44cd341657203722352efc9bc0c847d06ea6d2dc1cd1135e0a01" +dependencies = [ + "ahash", + "hashbrown", +] + [[package]] name = "indenter" version = "0.3.3" @@ -905,9 +1900,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown", @@ -922,17 +1917,38 @@ dependencies = [ "generic-array", ] +[[package]] +name = "io-close" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "ipnet" version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -949,11 +1965,36 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jiff" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eca28ccff1a040c4f83c56e153630c8337a8522b1e0a8618b89eace45d5df70" +dependencies = [ + "jiff-tzdb-platform", + "windows-sys 0.52.0", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05fac328b3df1c0f18a3c2ab6cb7e06e4e549f366017d796e3e66b6d6889abe6" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8da387d5feaf355954c2c122c194d6df9c57d865125a67984bb453db5336940" +dependencies = [ + "jiff-tzdb", +] + [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] @@ -967,11 +2008,30 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56" +dependencies = [ + "crossbeam", + "rayon", +] + [[package]] name = "keyring" -version = "3.0.3" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c118b1bc529b034aad851808f41f49a69a337d10e112039e7f342e5fd514635b" + +[[package]] +name = "kstring" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9961b98f55dc0b2737000132505bdafa249abab147ee9de43c50ae04a054aa6c" +checksum = "558bf9508a558512042d3095138b1f7b8fe90c5467d94f9f1da28b3731c5dbd1" +dependencies = [ + "static_assertions", +] [[package]] name = "lazy_static" @@ -1041,6 +2101,16 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "lockfree-object-pool" version = "0.1.6" @@ -1086,12 +2156,32 @@ dependencies = [ "crc", ] +[[package]] +name = "maybe-async" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "mime" version = "0.3.17" @@ -1109,13 +2199,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1250,9 +2341,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -1271,7 +2362,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1291,9 +2382,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -1310,12 +2401,12 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "os_pipe" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209" +checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1330,6 +2421,29 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.3", + "smallvec", + "windows-targets 0.52.6", +] + [[package]] name = "pbkdf2" version = "0.12.2" @@ -1374,7 +2488,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1395,6 +2509,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "portable-atomic" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" + [[package]] name = "powerfmt" version = "0.2.0" @@ -1403,9 +2523,22 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +dependencies = [ + "zerocopy 0.6.6", +] + +[[package]] +name = "pretty_env_logger" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" +dependencies = [ + "env_logger", + "log", +] [[package]] name = "proc-macro2" @@ -1416,6 +2549,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prodash" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a266d8d6020c61a437be704c5e618037588e1985c7dbb7bf8d265db84cffe325" +dependencies = [ + "bytesize", + "human_format", + "log", + "parking_lot", +] + [[package]] name = "pubgrub" version = "0.2.1" @@ -1447,12 +2592,16 @@ dependencies = [ "dirs", "fs_extra", "git2", + "gix", "itertools", "keyring", + "log", "openssl", "openssl-sys", "owo-colors 4.0.0", "pbr", + "pretty_env_logger", + "prodash", "pubgrub", "qpm_arg_tokenizer", "qpm_package", @@ -1530,14 +2679,13 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", "socket2", - "tracing", "windows-sys 0.52.0", ] @@ -1646,6 +2794,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "redox_users" version = "0.4.5" @@ -1701,9 +2858,11 @@ dependencies = [ "async-compression", "base64", "bytes", + "encoding_rs", "futures-channel", "futures-core", "futures-util", + "h2", "http", "http-body", "http-body-util", @@ -1727,6 +2886,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls", @@ -1788,9 +2948,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.11" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "once_cell", "ring", @@ -1818,9 +2978,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ "ring", "rustls-pki-types", @@ -1857,6 +3017,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "security-framework" version = "2.11.1" @@ -1918,25 +3084,26 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -1964,6 +3131,12 @@ dependencies = [ "digest", ] +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + [[package]] name = "sharded-slab" version = "0.1.7" @@ -1973,12 +3146,37 @@ 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 = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -1987,9 +3185,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "similar" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "slab" @@ -2030,9 +3228,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f4c14672714436c09254801c934b203196a51182a5107fb76591c7cc56424d" +checksum = "16569f53ca23a41bb6f62e0a5084aa1661f4814a67fa33696a79073e03a664af" dependencies = [ "anstream", ] @@ -2053,6 +3251,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "stopwatch" version = "0.0.7" @@ -2093,9 +3297,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -2108,6 +3312,27 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tempfile" version = "3.10.1" @@ -2137,24 +3362,33 @@ dependencies = [ "walkdir", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2217,9 +3451,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", @@ -2228,18 +3462,18 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2278,18 +3512,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.15" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap", "serde", @@ -2344,7 +3578,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2406,12 +3640,27 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "uluru" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c8a2469e56e6e5095c82ccd3afb98dad95f7af7929aab6d8ba8d6e0f73657da" +dependencies = [ + "arrayvec", +] + [[package]] name = "unicode-bidi" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +[[package]] +name = "unicode-bom" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -2476,9 +3725,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -2535,7 +3784,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-shared", ] @@ -2569,7 +3818,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2648,6 +3897,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -2771,9 +4029,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -2794,6 +4052,47 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" +[[package]] +name = "zerocopy" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" +dependencies = [ + "byteorder", + "zerocopy-derive 0.6.6", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy-derive" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -2811,7 +4110,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 072a8348..7e16f482 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,9 +12,11 @@ name = "qpm" path = "src/main.rs" [features] -default = ["templatr", "network_test"] +default = ["templatr", "network_test", "gitoxide"] templatr = ["dep:templatr"] network_test = [] +gitoxide = ["dep:gix", "dep:prodash"] +libgit2 = ["dep:git2"] [build-dependencies] vergen = { version = "8", features = ["build", "git", "gitcl"] } @@ -26,7 +28,7 @@ trycmd = "0.14" [dependencies] #qpm -qpm_package = { git = "https://github.com/QuestPackageManager/QPM.Package.git"} +qpm_package = { git = "https://github.com/QuestPackageManager/QPM.Package.git" } qpm_qmod = { git = "https://github.com/QuestPackageManager/QPM.Qmod.git" } qpm_arg_tokenizer = { git = "https://github.com/QuestPackageManager/QPM.arg_tokenizer.git" } templatr = { git = "https://github.com/QuestPackageManager/templatr.git", optional = true } @@ -36,10 +38,29 @@ color-eyre = { version = "0.6", default-features = false } # progress bar pbr = "*" #{ git = "https://github.com/a8m/pb.git" } -git2 = "0.19" +git2 = { version = "0.19", optional = true } + +#gitoxide +# gix = {git = "https://github.com/Byron/gitoxide.git", features = ["command", "attributes", "progress-tree", "worktree-mutation", "blocking-network-client", "blocking-http-transport-reqwest-rust-tls"], optional = true } +gix = { git = "https://github.com/Fernthedev/gitoxide.git", branch = "feat/checkout-with-ref-name", features = [ + "command", + "attributes", + "progress-tree", + "worktree-mutation", + "blocking-network-client", + "blocking-http-transport-reqwest-rust-tls", +], optional = true } +prodash = { version = "*", features = ["progress-log"], optional = true } +pretty_env_logger = "0.5" +log = "0.4" #tokio fix -tokio = { version = ">=1.33", features = ["io-util", "io-std", "net", "macros"] } +tokio = { version = ">=1.33", features = [ + "io-util", + "io-std", + "net", + "macros", +] } bytes = "*" reqwest = { version = "0.12", features = [ diff --git a/src/commands/restore.rs b/src/commands/restore.rs index 93e4cf3c..5fda5886 100644 --- a/src/commands/restore.rs +++ b/src/commands/restore.rs @@ -38,7 +38,8 @@ pub struct RestoreCommand { offline: bool, } -fn is_ignored() -> bool { +#[cfg(feature = "libgit2")] +pub(crate) fn is_ignored() -> bool { git2::Repository::open(".").is_ok_and(|r| { r.is_path_ignored(SHARED_PACKAGE_FILE_NAME) == Ok(true) || r.status_file(Path::new(SHARED_PACKAGE_FILE_NAME)) @@ -46,6 +47,21 @@ fn is_ignored() -> bool { }) } +#[cfg(feature = "gitoxide")] +pub(crate) fn is_ignored() -> bool { + gix::open(".").is_ok_and(|r| { + let Ok(index) = r.index() else {return false}; + + let excludes = r.excludes(&index, None, Default::default()); + + excludes.is_ok_and(|mut attribute| { + attribute + .at_path(SHARED_PACKAGE_FILE_NAME, Some(gix::index::entry::Mode::FILE)) + .is_ok_and(|e| e.is_excluded()) + }) + }) +} + impl Command for RestoreCommand { fn execute(self) -> color_eyre::Result<()> { let package = PackageConfig::read(".")?; diff --git a/src/main.rs b/src/main.rs index 2e9971c7..7ab8c641 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,15 @@ mod benchmark; #[cfg(test)] mod tests; + +#[cfg(all(feature = "gitoxide", feature = "libgit2"))] +compile_error!("feature \"gitoxide\" and feature \"libgit2\" cannot be enabled at the same time"); + fn main() -> Result<()> { + pretty_env_logger::formatted_builder() + .filter_level(log::LevelFilter::Info) + .parse_default_env() + .init(); color_eyre::config::HookBuilder::default() .panic_section(concat!( "version ", diff --git a/src/repository/qpackages.rs b/src/repository/qpackages.rs index 69241bad..10933613 100644 --- a/src/repository/qpackages.rs +++ b/src/repository/qpackages.rs @@ -175,7 +175,7 @@ impl QPMRepository { // github url! git::clone( url.clone(), - config.info.additional_data.branch_name.as_ref(), + config.info.additional_data.branch_name.as_deref(), &tmp_path, ) .context("Clone")?; diff --git a/src/utils/git.rs b/src/utils/git.rs index 22c9bc17..4c2591bb 100644 --- a/src/utils/git.rs +++ b/src/utils/git.rs @@ -1,13 +1,8 @@ -use std::{ - fs::File, - io::{BufReader, BufWriter}, - path::Path, - process::{Command, Stdio}, -}; +use std::{fs::File, io::BufWriter, path::Path}; use color_eyre::{ eyre::{bail, Context}, - Result, Section, + Result, }; use owo_colors::OwoColorize; //use duct::cmd; @@ -19,6 +14,7 @@ use crate::{ terminal::colors::QPMColor, }; +#[cfg(feature = "libgit2")] pub fn check_git() -> Result<()> { let mut git = std::process::Command::new("git"); git.arg("--version"); @@ -49,6 +45,11 @@ pub fn check_git() -> Result<()> { } } +#[cfg(feature = "gitoxide")] +pub fn check_git() -> Result<()> { + Ok(()) +} + pub fn get_release(url: &str, out: &std::path::Path) -> Result { check_git()?; if let Ok(token_unwrapped) = get_keyring().get_password() { @@ -125,7 +126,8 @@ pub fn get_release_with_token(url: &str, out: &std::path::Path, token: &str) -> Ok(out.exists()) } -pub fn clone(mut url: String, branch: Option<&String>, out: &Path) -> Result { +#[cfg(feature = "libgit2")] +pub fn clone(mut url: String, branch: Option<&str>, out: &Path) -> Result { check_git()?; if let Ok(token_unwrapped) = get_keyring().get_password() { if let Some(gitidx) = url.find("github.com") { @@ -189,6 +191,162 @@ pub fn clone(mut url: String, branch: Option<&String>, out: &Path) -> Result color_eyre::Result<()> { + use std::num::NonZero; + + use prodash::progress::Log; + + use color_eyre::eyre::ContextCompat; + use gix::{ + bstr::BStr, + clone::{PrepareCheckout, PrepareFetch}, + submodule::config::Update, + }; + + use crate::utils::progress::PbrProgress; + + let Some(mut submodules) = repo.submodules().context("Submodules listing")? else { + return Ok(()); + }; + + println!( + "Recursive cloning submodules for {}", + repo.path().display().file_path_color() + ); + + submodules.try_for_each(|submodule| -> color_eyre::Result<()> { + println!( + "Cloning submodule {} {}", + submodule.name().download_file_name_color(), + submodule.path()?.file_path_color() + ); + + let update = submodule.update()?.unwrap_or(Default::default()); + + if update == Update::None { + return Ok(()); + } + + let sub_url = submodule.url()?; + let sub_path = submodule.work_dir()?; + + let mut prepare_clone = gix::prepare_clone(sub_url, &sub_path) + .with_context(|| format!("Preparing submodule clone {sub_path:?}"))? + .with_shallow(gix::remote::fetch::Shallow::DepthAtRemote( + NonZero::new(1).unwrap(), + )); + + let (mut prepare_checkout, _) = prepare_clone + .fetch_then_checkout( + // prodash::progress::Log::new("Fetch", None), + PbrProgress::default(), + &gix::interrupt::IS_INTERRUPTED, + ) + .with_context(|| format!("Fetching and checking out submodule {sub_path:?}"))?; + + println!( + "Checking out submodule {} into {:?} ...", + submodule.name(), + prepare_checkout + .repo() + .work_dir() + .context("repo work dir")? + ); + + if let Some(index_id) = submodule.index_id()? { + prepare_checkout = prepare_checkout.with_object_id(Some(index_id)); + } + + let (sub_repo, _) = prepare_checkout + .main_worktree(PbrProgress::default(), &gix::interrupt::IS_INTERRUPTED) + .with_context(|| format!("Submodule worktree {}", submodule.name()))?; + + recursive_update(&sub_repo) + .with_context(|| format!("Cloning submodules of {sub_path:?}")) + })?; + + Ok(()) +} + +#[cfg(feature = "gitoxide")] +pub fn clone(url: String, branch: Option<&str>, out: &Path) -> Result { + use std::num::NonZero; + + use color_eyre::eyre::{ContextCompat, OptionExt}; + use gix::{bstr::BStr, head, refs::PartialName, submodule::config::Update, trace::warn}; + + use crate::{terminal::colors::QPMColor, utils::progress::PbrProgress}; + + check_git()?; + // TODO: Figure out tokens\ + // TODO: Clone submodules + + let branch_ref: Option = branch.map(PartialName::try_from).transpose()?; + + let mut prepare_clone = gix::prepare_clone(gix::url::parse(url.as_str().into())?, out)? + .with_shallow(gix::remote::fetch::Shallow::DepthAtRemote( + NonZero::new(1).unwrap(), + )) + .with_ref_name(branch_ref.as_ref())?; + + let (mut prepare_checkout, _) = prepare_clone.fetch_then_checkout( + // prodash::progress::Log::new("Fetch", None), + PbrProgress::default(), + &gix::interrupt::IS_INTERRUPTED, + )?; + + println!( + "Checking out into {:?} ...", + prepare_checkout + .repo() + .work_dir() + .context("repo work dir")? + ); + + // let branch_ref = branch + // .map(|b| prepare_checkout.repo().find_reference(b)) + // .transpose()?; + + // let branch_fn = branch.map(|b| { + // let str = b.to_string(); + // move |r: &'a Repository| -> Reference<'a> { + // r.find_reference(str.as_str()) + // .expect("remote branch not found") + // } + // }); + + let (repo, _) = prepare_checkout + .main_worktree(PbrProgress::default(), &gix::interrupt::IS_INTERRUPTED) + .with_context(|| format!("Checkout {branch:?}"))?; + + recursive_update(&repo).with_context(|| format!("Cloning submodules of root repo"))?; + + println!( + "Repo cloned into {:?}", + repo.work_dir().expect("directory pre-created") + ); + + let remote = repo + .find_default_remote(gix::remote::Direction::Fetch) + .expect("always present after clone")?; + + println!( + "Default remote: {} -> {}", + remote + .name() + .expect("default remote is always named") + .as_bstr(), + remote + .url(gix::remote::Direction::Fetch) + .expect("should be the remote URL") + .to_bstring(), + ); + + Ok(out.try_exists()?) +} + #[derive(Serialize, Deserialize, Debug)] pub struct GithubReleaseAsset { pub url: String, diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 0961fcca..add594e9 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -4,3 +4,6 @@ pub mod fs; pub mod git; pub mod json; pub mod toggle; + +#[cfg(feature = "gitoxide")] +pub mod progress; \ No newline at end of file diff --git a/src/utils/progress.rs b/src/utils/progress.rs new file mode 100644 index 00000000..84612d7a --- /dev/null +++ b/src/utils/progress.rs @@ -0,0 +1,86 @@ +use std::{ + io::Stdout, + sync::{atomic::AtomicUsize, Arc, RwLock}, +}; + +use gix::{Count, NestedProgress, Progress}; +use log::{debug, error}; +use pbr::ProgressBar; + +pub struct PbrProgress { + pbr: std::sync::RwLock>, +} + +impl Default for PbrProgress { + fn default() -> Self { + Self { + pbr: RwLock::new(ProgressBar::new(100)), + } + } +} + +impl Count for PbrProgress { + fn set(&self, step: prodash::progress::Step) { + self.pbr.write().unwrap().set(step.try_into().unwrap()); + } + + fn step(&self) -> prodash::progress::Step { + self.pbr.write().unwrap().add(0).try_into().unwrap() + } + + fn inc_by(&self, step: prodash::progress::Step) { + self.pbr.write().unwrap().add(step.try_into().unwrap()); + } + + /// I don't have any other alternatives here + fn counter(&self) -> gix::progress::StepShared { + Arc::new(AtomicUsize::new(self.step())) + } +} + +impl Progress for PbrProgress { + fn init(&mut self, max: Option, _unit: Option) { + if let Some(max) = max { + self.pbr.write().unwrap().total = max.try_into().unwrap(); + } + } + + fn set_name(&mut self, _name: String) {} + + fn name(&self) -> Option { + None + } + + fn id(&self) -> gix::progress::Id { + Default::default() + } + + fn message(&self, level: gix::progress::MessageLevel, message: String) { + match level { + gix::progress::MessageLevel::Info => debug!("Progressing: {}", message), + gix::progress::MessageLevel::Failure => error!("Failure: {}", message), + gix::progress::MessageLevel::Success => { + self.pbr.write().unwrap().finish_println(""); + println!(); + println!("{}", message); + } + } + } +} + +// I genuinely don't care +impl NestedProgress for PbrProgress { + type SubProgress = PbrProgress; + + fn add_child(&mut self, _name: impl Into) -> Self::SubProgress { + PbrProgress::default() + } + + fn add_child_with_id( + &mut self, + _name: impl Into, + _id: gix::progress::Id, + ) -> Self::SubProgress { + PbrProgress::default() + } +}