lints.workspace = true [package] name = "src-diff" version = "0.60.0" repository = "https://github.com/GitoxideLabs/gitoxide" license = "MIT OR Apache-2.0" description = "Calculate differences between various git objects" authors = ["Sebastian Thiel "] edition = "2021" include = ["src/**/*", "LICENSE-*"] rust-version = "1.82" autotests = false [features] default = ["blob", "index"] ## Enable support for the SHA-1 hash by enabling the respective feature in the `src-hash` crate. sha1 = ["src-hash/sha1"] ## Enable diffing of blobs using imara-diff. blob = [ "dep:imara-diff", "dep:src-filter", "dep:src-worktree", "dep:src-path", "dep:src-fs", "dep:src-command", "dep:src-tempfile", "dep:src-trace", "dep:src-traverse" ] ## An experimental use of the v0.2 branch of `imara-diff` to allow trying it out, and for writing tests against it more easily. ## We will decide later how it should actually be exposed. blob-experimental = ["dep:imara-diff-v2"] ## Enable diffing of two indices, which also allows for a generic rewrite tracking implementation. index = ["dep:src-index", "dep:src-pathspec", "dep:src-attributes"] ## Data structures implement `serde::Serialize` and `serde::Deserialize`. serde = ["dep:serde", "src-hash/serde", "src-object/serde", "src-index?/serde"] ## Make it possible to compile to the `wasm32-unknown-unknown` target. wasm = ["dep:getrandom"] [lib] doctest = false [[bench]] name = "line-count" harness = false path = "./benches/line_count.rs" [dependencies] src-index = { version = "^0.48.0", path = "../src-index", optional = true } src-pathspec = { version = "^0.16.0", path = "../src-pathspec", optional = true } src-attributes = { version = "^0.31.0", path = "../src-attributes", optional = true } src-hash = { version = "^0.22.1", path = "../src-hash" } src-object = { version = "^0.57.0", path = "../src-object" } src-filter = { version = "^0.27.0", path = "../src-filter", optional = true } src-worktree = { version = "^0.49.0", path = "../src-worktree", default-features = false, features = ["attributes"], optional = true } src-command = { version = "^0.8.0", path = "../src-command", optional = true } src-path = { version = "^0.11.1", path = "../src-path", optional = true } src-fs = { version = "^0.19.1", path = "../src-fs", optional = true } src-tempfile = { version = "^21.0.0", path = "../src-tempfile", optional = true } src-trace = { version = "^0.1.18", path = "../src-trace", optional = true } src-traverse = { version = "^0.54.0", path = "../src-traverse", optional = true } thiserror = "2.0.18" imara-diff = { version = "0.2.0", optional = true } imara-diff-v2 = { version = "0.2.0", optional = true, package = "imara-diff" } serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] } getrandom = { version = "0.2.17", optional = true, default-features = false, features = ["js"] } bstr = { version = "1.12.0", default-features = false } document-features = { version = "0.2.0", optional = true } [dev-dependencies] criterion = "0.8.2" imara-diff-v2 = { version = "0.2.0", package = "imara-diff" } src-hash = { path = "../src-hash", features = ["sha1"] } [package.metadata.docs.rs] all-features = true features = ["sha1", "document-features"] [package.metadata.cargo-machete] ignored = [ # WASM support dependency activated through the `wasm = ["dep:getrandom"]` feature. "getrandom", # Optional API feature wiring (`dep:serde`) referenced only from feature definitions. "serde", ]