This also removes all diff capabilities.
Unified · Split
| @@ -58,7 +58,7 @@ default = ["max-performance-safe", "comfort", "extras"] · 57 unmodified lines | |||
| 58 | #! Bundles are for convenience only and bear no further meaning beyond the cargo manifest file. | 58 | #! Bundles are for convenience only and bear no further meaning beyond the cargo manifest file. |
| 59 | 59 | ||
| 60 | ## Various additional features and capabilities that are not necessarily part of what most users would need. | 60 | ## Various additional features and capabilities that are not necessarily part of what most users would need. |
| 61 | extras = ["worktree-stream", "worktree-archive"] | 61 | extras = ["worktree-stream", "worktree-archive", "blob-diff"] |
| 62 | 62 | ||
| 63 | ## Various progress-related features that improve the look of progress message units. | 63 | ## Various progress-related features that improve the look of progress message units. |
| 64 | comfort = ["gix-features/progress-unit-bytes", "gix-features/progress-unit-human-numbers"] | 64 | comfort = ["gix-features/progress-unit-bytes", "gix-features/progress-unit-human-numbers"] |
| @@ -68,6 +68,10 @@ comfort = ["gix-features/progress-unit-bytes", "gix-features/progress-unit-human · 3 unmodified lines | |||
| 68 | #! A component is a distinct feature which may be comprised of one or more methods around a particular topic. | 68 | #! A component is a distinct feature which may be comprised of one or more methods around a particular topic. |
| 69 | #! Providers of libraries should only activate | 69 | #! Providers of libraries should only activate |
| 70 | 70 | ||
| 71 | ## Make it possible to diff blobs line by line. Note that this feature is integral for implementing tree-diffs as well due to the handling of rename-tracking, | ||
| 72 | ## which relies on line-by-line diffs in some cases. | ||
| 73 | blob-diff = ["gix-diff/blob"] | ||
| 74 | |||
| 71 | ## Make it possible to turn a tree into a stream of bytes, which can be decoded to entries and turned into various other formats. | 75 | ## Make it possible to turn a tree into a stream of bytes, which can be decoded to entries and turned into various other formats. |
| 72 | worktree-stream = ["gix-worktree-stream"] | 76 | worktree-stream = ["gix-worktree-stream"] |
| 73 | 77 | ||
| @@ -189,7 +193,7 @@ gix-negotiate = { version = "^0.6.0", path = "../gix-negotiate" } · 115 unmodified lines | |||
| 189 | gix-path = { version = "^0.9.0", path = "../gix-path" } | 193 | gix-path = { version = "^0.9.0", path = "../gix-path" } |
| 190 | gix-url = { version = "^0.22.0", path = "../gix-url" } | 194 | gix-url = { version = "^0.22.0", path = "../gix-url" } |
| 191 | gix-traverse = { version = "^0.31.0", path = "../gix-traverse" } | 195 | gix-traverse = { version = "^0.31.0", path = "../gix-traverse" } |
| 192 | gix-diff = { version = "^0.34.0", path = "../gix-diff" } | 196 | gix-diff = { version = "^0.34.0", path = "../gix-diff", default-features = false } |
| 193 | gix-mailmap = { version = "^0.17.0", path = "../gix-mailmap" } | 197 | gix-mailmap = { version = "^0.17.0", path = "../gix-mailmap" } |
| 194 | gix-features = { version = "^0.33.0", path = "../gix-features", features = ["progress", "once_cell"] } | 198 | gix-features = { version = "^0.33.0", path = "../gix-features", features = ["progress", "once_cell"] } |
| 195 | gix-trace = { version = "^0.1.3", path = "../gix-trace" } | 199 | gix-trace = { version = "^0.1.3", path = "../gix-trace" } |
| @@ -9,7 +9,7 @@ use crate::{ · 8 unmodified lines | |||
| 9 | config, | 9 | config, |
| 10 | config::{ | 10 | config::{ |
| 11 | boolean, | 11 | boolean, |
| 12 | cache::util::{ApplyLeniency, ApplyLeniencyDefault, ApplyLeniencyDefaultValue}, | 12 | cache::util::{ApplyLeniency, ApplyLeniencyDefaultValue}, |
| 13 | checkout_options, | 13 | checkout_options, |
| 14 | tree::{gitoxide, Checkout, Core, Key}, | 14 | tree::{gitoxide, Checkout, Core, Key}, |
| 15 | Cache, | 15 | Cache, |
| @@ -21,7 +21,9 @@ use crate::{ · 5 unmodified lines | |||
| 21 | 21 | ||
| 22 | /// Access | 22 | /// Access |
| 23 | impl Cache { | 23 | impl Cache { |
| 24 | #[cfg(feature = "blob-diff")] | ||
| 24 | pub(crate) fn diff_algorithm(&self) -> Result<gix_diff::blob::Algorithm, config::diff::algorithm::Error> { | 25 | pub(crate) fn diff_algorithm(&self) -> Result<gix_diff::blob::Algorithm, config::diff::algorithm::Error> { |
| 26 | use crate::config::cache::util::ApplyLeniencyDefault; | ||
| 25 | use crate::config::diff::algorithm::Error; | 27 | use crate::config::diff::algorithm::Error; |
| 26 | self.diff_algorithm | 28 | self.diff_algorithm |
| 27 | .get_or_try_init(|| { | 29 | .get_or_try_init(|| { |
| @@ -82,6 +84,7 @@ impl Cache { · 54 unmodified lines | |||
| 82 | }) | 84 | }) |
| 83 | } | 85 | } |
| 84 | 86 | ||
| 87 | #[cfg(feature = "blob-diff")] | ||
| 85 | pub(crate) fn diff_renames( | 88 | pub(crate) fn diff_renames( |
| 86 | &self, | 89 | &self, |
| 87 | ) -> Result<Option<crate::object::tree::diff::Rewrites>, crate::object::tree::diff::rewrites::Error> { | 90 | ) -> Result<Option<crate::object::tree::diff::Rewrites>, crate::object::tree::diff::rewrites::Error> { |
| @@ -174,9 +174,11 @@ impl Cache { · 173 unmodified lines | |||
| 174 | user_agent: Default::default(), | 174 | user_agent: Default::default(), |
| 175 | personas: Default::default(), | 175 | personas: Default::default(), |
| 176 | url_rewrite: Default::default(), | 176 | url_rewrite: Default::default(), |
| 177 | #[cfg(feature = "blob-diff")] | ||
| 177 | diff_renames: Default::default(), | 178 | diff_renames: Default::default(), |
| 178 | #[cfg(any(feature = "blocking-network-client", feature = "async-network-client"))] | 179 | #[cfg(any(feature = "blocking-network-client", feature = "async-network-client"))] |
| 179 | url_scheme: Default::default(), | 180 | url_scheme: Default::default(), |
| 181 | #[cfg(feature = "blob-diff")] | ||
| 180 | diff_algorithm: Default::default(), | 182 | diff_algorithm: Default::default(), |
| 181 | }) | 183 | }) |
| 182 | } | 184 | } |
| @@ -222,8 +224,11 @@ impl Cache { · 39 unmodified lines | |||
| 222 | self.user_agent = Default::default(); | 224 | self.user_agent = Default::default(); |
| 223 | self.personas = Default::default(); | 225 | self.personas = Default::default(); |
| 224 | self.url_rewrite = Default::default(); | 226 | self.url_rewrite = Default::default(); |
| 225 | self.diff_renames = Default::default(); | 227 | #[cfg(feature = "blob-diff")] |
| 226 | self.diff_algorithm = Default::default(); | 228 | { |
| 229 | self.diff_renames = Default::default(); | ||
| 230 | self.diff_algorithm = Default::default(); | ||
| 231 | } | ||
| 227 | ( | 232 | ( |
| 228 | self.static_pack_cache_limit_bytes, | 233 | self.static_pack_cache_limit_bytes, |
| 229 | self.pack_cache_bytes, | 234 | self.pack_cache_bytes, |
| @@ -495,11 +495,13 @@ pub(crate) struct Cache { · 494 unmodified lines | |||
| 495 | /// A lazily loaded rewrite list for remote urls | 495 | /// A lazily loaded rewrite list for remote urls |
| 496 | pub(crate) url_rewrite: OnceCell<crate::remote::url::Rewrite>, | 496 | pub(crate) url_rewrite: OnceCell<crate::remote::url::Rewrite>, |
| 497 | /// The lazy-loaded rename information for diffs. | 497 | /// The lazy-loaded rename information for diffs. |
| 498 | #[cfg(feature = "blob-diff")] | ||
| 498 | pub(crate) diff_renames: OnceCell<Option<crate::object::tree::diff::Rewrites>>, | 499 | pub(crate) diff_renames: OnceCell<Option<crate::object::tree::diff::Rewrites>>, |
| 499 | /// A lazily loaded mapping to know which url schemes to allow | 500 | /// A lazily loaded mapping to know which url schemes to allow |
| 500 | #[cfg(any(feature = "blocking-network-client", feature = "async-network-client"))] | 501 | #[cfg(any(feature = "blocking-network-client", feature = "async-network-client"))] |
| 501 | pub(crate) url_scheme: OnceCell<crate::remote::url::SchemePermission>, | 502 | pub(crate) url_scheme: OnceCell<crate::remote::url::SchemePermission>, |
| 502 | /// The algorithm to use when diffing blobs | 503 | /// The algorithm to use when diffing blobs |
| 504 | #[cfg(feature = "blob-diff")] | ||
| 503 | pub(crate) diff_algorithm: OnceCell<gix_diff::blob::Algorithm>, | 505 | pub(crate) diff_algorithm: OnceCell<gix_diff::blob::Algorithm>, |
| 504 | /// The amount of bytes to use for a memory backed delta pack cache. If `Some(0)`, no cache is used, if `None` | 506 | /// The amount of bytes to use for a memory backed delta pack cache. If `Some(0)`, no cache is used, if `None` |
| 505 | /// a standard cache is used which costs near to nothing and always pays for itself. | 507 | /// a standard cache is used which costs near to nothing and always pays for itself. |
| @@ -31,6 +31,7 @@ pub(crate) mod root { · 30 unmodified lines | |||
| 31 | /// The `credential` section. | 31 | /// The `credential` section. |
| 32 | pub const CREDENTIAL: sections::Credential = sections::Credential; | 32 | pub const CREDENTIAL: sections::Credential = sections::Credential; |
| 33 | /// The `diff` section. | 33 | /// The `diff` section. |
| 34 | #[cfg(feature = "blob-diff")] | ||
| 34 | pub const DIFF: sections::Diff = sections::Diff; | 35 | pub const DIFF: sections::Diff = sections::Diff; |
| 35 | /// The `extensions` section. | 36 | /// The `extensions` section. |
| 36 | pub const EXTENSIONS: sections::Extensions = sections::Extensions; | 37 | pub const EXTENSIONS: sections::Extensions = sections::Extensions; |
| @@ -69,6 +70,7 @@ pub(crate) mod root { · 32 unmodified lines | |||
| 69 | &Self::COMMITTER, | 70 | &Self::COMMITTER, |
| 70 | &Self::CORE, | 71 | &Self::CORE, |
| 71 | &Self::CREDENTIAL, | 72 | &Self::CREDENTIAL, |
| 73 | #[cfg(feature = "blob-diff")] | ||
| 72 | &Self::DIFF, | 74 | &Self::DIFF, |
| 73 | &Self::EXTENSIONS, | 75 | &Self::EXTENSIONS, |
| 74 | &Self::FETCH, | 76 | &Self::FETCH, |
| @@ -90,10 +92,12 @@ pub(crate) mod root { · 15 unmodified lines | |||
| 90 | 92 | ||
| 91 | mod sections; | 93 | mod sections; |
| 92 | pub use sections::{ | 94 | pub use sections::{ |
| 93 | branch, checkout, core, credential, diff, extensions, fetch, gitoxide, http, index, protocol, remote, ssh, Author, | 95 | branch, checkout, core, credential, extensions, fetch, gitoxide, http, index, protocol, remote, ssh, Author, |
| 94 | Branch, Checkout, Clone, Committer, Core, Credential, Diff, Extensions, Fetch, Gitoxide, Http, Index, Init, Pack, | 96 | Branch, Checkout, Clone, Committer, Core, Credential, Extensions, Fetch, Gitoxide, Http, Index, Init, Pack, |
| 95 | Protocol, Remote, Safe, Ssh, Url, User, | 97 | Protocol, Remote, Safe, Ssh, Url, User, |
| 96 | }; | 98 | }; |
| 99 | #[cfg(feature = "blob-diff")] | ||
| 100 | pub use sections::{diff, Diff}; | ||
| 97 | 101 | ||
| 98 | /// Generic value implementations for static instantiation. | 102 | /// Generic value implementations for static instantiation. |
| 99 | pub mod keys; | 103 | pub mod keys; |
| @@ -37,7 +37,9 @@ pub mod credential; · 36 unmodified lines | |||
| 37 | 37 | ||
| 38 | /// The `diff` top-level section. | 38 | /// The `diff` top-level section. |
| 39 | #[derive(Copy, Clone, Default)] | 39 | #[derive(Copy, Clone, Default)] |
| 40 | #[cfg(feature = "blob-diff")] | ||
| 40 | pub struct Diff; | 41 | pub struct Diff; |
| 42 | #[cfg(feature = "blob-diff")] | ||
| 41 | pub mod diff; | 43 | pub mod diff; |
| 42 | 44 | ||
| 43 | /// The `extension` top-level section. | 45 | /// The `extension` top-level section. |
| @@ -1,4 +1,5 @@ | |||
| 1 | /// | 1 | /// |
| 2 | #[cfg(feature = "blob-diff")] | ||
| 2 | pub mod diff { | 3 | pub mod diff { |
| 3 | use std::ops::Range; | 4 | use std::ops::Range; |
| 4 | 5 | ||
| @@ -168,6 +168,7 @@ impl<'repo> Tree<'repo> { · 167 unmodified lines | |||
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | /// | 170 | /// |
| 171 | #[cfg(feature = "blob-diff")] | ||
| 171 | pub mod diff; | 172 | pub mod diff; |
| 172 | 173 | ||
| 173 | /// | 174 | /// |
| @@ -204,6 +204,7 @@ mod fetch { · 203 unmodified lines | |||
| 204 | } | 204 | } |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | #[cfg(feature = "blob-diff")] | ||
| 207 | mod diff { | 208 | mod diff { |
| 208 | use gix::{ | 209 | use gix::{ |
| 209 | config::tree::{Diff, Key}, | 210 | config::tree::{Diff, Key}, |
| @@ -1,5 +1,6 @@ | |||
| 1 | use crate::util::{named_repo, named_subrepo_opts}; | 1 | use crate::util::{named_repo, named_subrepo_opts}; |
| 2 | 2 | ||
| 3 | #[cfg(feature = "blob-diff")] | ||
| 3 | mod diff; | 4 | mod diff; |
| 4 | 5 | ||
| 5 | #[test] | 6 | #[test] |
| @@ -42,6 +42,7 @@ check: · 41 unmodified lines | |||
| 42 | if cargo check -p gix-packetline --all-features 2>/dev/null; then false; else true; fi | 42 | if cargo check -p gix-packetline --all-features 2>/dev/null; then false; else true; fi |
| 43 | if cargo check -p gix-transport --all-features 2>/dev/null; then false; else true; fi | 43 | if cargo check -p gix-transport --all-features 2>/dev/null; then false; else true; fi |
| 44 | if cargo check -p gix-protocol --all-features 2>/dev/null; then false; else true; fi | 44 | if cargo check -p gix-protocol --all-features 2>/dev/null; then false; else true; fi |
| 45 | if cargo tree -p gix --no-default-features -i imara-diff 2>/dev/null; then false; else true; fi | ||
| 45 | cargo check --no-default-features --features lean | 46 | cargo check --no-default-features --features lean |
| 46 | cargo check --no-default-features --features lean-async | 47 | cargo check --no-default-features --features lean-async |
| 47 | cargo check --no-default-features --features max | 48 | cargo check --no-default-features --features max |
| @@ -111,6 +112,7 @@ check: · 63 unmodified lines | |||
| 111 | cargo check -p gix --no-default-features --features max-performance | 112 | cargo check -p gix --no-default-features --features max-performance |
| 112 | cargo check -p gix --no-default-features --features max-performance-safe | 113 | cargo check -p gix --no-default-features --features max-performance-safe |
| 113 | cargo check -p gix --no-default-features --features progress-tree | 114 | cargo check -p gix --no-default-features --features progress-tree |
| 115 | cargo check -p gix --no-default-features --features blob-diff | ||
| 114 | cargo check -p gix --no-default-features | 116 | cargo check -p gix --no-default-features |
| 115 | cargo check -p gix-odb --features serde | 117 | cargo check -p gix-odb --features serde |
| 116 | cargo check --no-default-features --features max-control | 118 | cargo check --no-default-features --features max-control |