Skip to content

Commit 7766cf9

Browse files
committed
feat: make blob-diffing a feature so it can be turned off by adding the blob feature (enabled by default)
1 parent 7aa231e commit 7766cf9

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gix-diff/Cargo.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ rust-version = "1.65"
1111
autotests = false
1212

1313
[features]
14+
default = ["blob"]
15+
## Enable diffing of blobs using imara-diff.
16+
blob = ["dep:imara-diff"]
1417
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
1518
serde = ["dep:serde", "gix-hash/serde", "gix-object/serde"]
1619
## Make it possible to compile to the `wasm32-unknown-unknown` target.
@@ -23,6 +26,13 @@ doctest = false
2326
gix-hash = { version = "^0.11.4", path = "../gix-hash" }
2427
gix-object = { version = "^0.34.0", path = "../gix-object" }
2528
thiserror = "1.0.32"
26-
imara-diff = "0.1.3"
29+
imara-diff = { version = "0.1.3", optional = true }
2730
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
2831
getrandom = { version = "0.2.8", optional = true, default-features = false, features = ["js"] }
32+
33+
document-features = { version = "0.2.0", optional = true }
34+
35+
[package.metadata.docs.rs]
36+
all-features = true
37+
features = ["document-features"]
38+
rustdoc-args = ["--cfg", "docsrs"]

gix-diff/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
//! Algorithms for diffing various git object types and for generating patches, highly optimized for performance.
2+
//! ## Feature Flags
3+
#![cfg_attr(
4+
feature = "document-features",
5+
cfg_attr(doc, doc = ::document_features::document_features!())
6+
)]
7+
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
28
#![deny(missing_docs, rust_2018_idioms)]
39
#![forbid(unsafe_code)]
410

511
///
612
pub mod tree;
713

814
///
15+
#[cfg(feature = "blob")]
916
pub mod blob;

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ check:
9999
cargo check -p gix-config-value
100100
cargo check -p gix-config --all-features
101101
cargo check -p gix-config
102+
cargo check -p gix-diff --no-default-features
102103
cargo check -p gix-transport
103104
cargo check -p gix-transport --features blocking-client
104105
cargo check -p gix-transport --features async-client

0 commit comments

Comments
 (0)