Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,22 +558,15 @@ jobs:
gix-bitmap
gix-chunk
gix-command
gix-commitgraph
gix-config-value
gix-date
gix-glob
gix-hash
gix-hashtable
gix-mailmap
gix-object
gix-packetline
gix-path
gix-pathspec
gix-prompt
gix-quote
gix-refspec
gix-revision
gix-traverse
gix-url
gix-validate
)
Expand All @@ -587,11 +580,26 @@ jobs:
for feature in progress parallel io-pipe crc32 zlib cache-efficiency-debug; do
cargo build -p gix-features --features "$feature" --target "$TARGET"
done
- name: crates with 'wasm' feature
- name: crates with 'sha1' and 'wasm' feature
run: |
set -x
for crate in gix-pack; do
cargo build -p "$crate" --features wasm --target "$TARGET"
cargo build -p "$crate" --features sha1,wasm --target "$TARGET"
done
- name: crates with 'sha1' feature
run: |
crates=(
gix-commitgraph
gix-hash
gix-hashtable
gix-object
gix-refspec
gix-revision
gix-traverse
)
set -x
for crate in "${crates[@]}"; do
cargo build -p "$crate" --features sha1 --target "$TARGET"
done
- name: gix-pack with all features (including wasm)
run: cargo build -p gix-pack --all-features --target "$TARGET"
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ default = ["max"]
##
## When used in conjunction with `http-client-curl-rustls`, the `openssl` crates will still be compiled, but won't be used. To bypass this, disable
## default dependencies and specify the features yourself.
max = ["max-control", "fast", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-blocking-client", "http-client-curl-openssl"]
max = ["hashes", "max-control", "fast", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-blocking-client", "http-client-curl-openssl"]

## Like `max`, but only Rust is allowed.
##
Expand All @@ -51,22 +51,23 @@ max = ["max-control", "fast", "gitoxide-core-tools-query", "gitoxide-core-tools-
## This uses Rust's HTTP implementation.
##
## As fast as possible, with TUI progress, progress line rendering with auto-configuration, all transports available but less mature pure Rust HTTP implementation, all `ein` tools, CLI colors and local-time support, JSON output, regex support for rev-specs.
max-pure = ["max-control", "http-client-reqwest", "gitoxide-core-blocking-client"]
max-pure = ["hashes", "max-control", "http-client-reqwest", "gitoxide-core-blocking-client"]

## Like `max`, but with more control for configuration. See the *Package Maintainers* headline for more information.
## Needs to chose its own hash(es).
max-control = ["tracing", "fast", "pretty-cli", "gitoxide-core-tools", "prodash-render-line", "prodash-render-tui", "prodash/render-line-autoconfigure", "gix/revparse-regex"]

## All the good stuff, with less fanciness for smaller binaries.
##
## As fast as possible, progress line rendering, all transports based on their most mature implementation (HTTP), all `ein` tools, CLI colors and local-time support, JSON output.
lean = ["fast", "tracing", "pretty-cli", "http-client-curl-openssl", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-tools", "gitoxide-core-blocking-client", "prodash-render-line"]
lean = ["hashes", "fast", "tracing", "pretty-cli", "http-client-curl-openssl", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-tools", "gitoxide-core-blocking-client", "prodash-render-line"]

## The smallest possible build, best suitable for small single-core machines.
##
## This build is essentially limited to local operations without any fanciness. It does not have `gix clone`.
##
## Optimized for size, no parallelism thus much slower, progress line rendering.
small = ["pretty-cli", "prodash-render-line", "is-terminal"]
small = ["hashes", "pretty-cli", "prodash-render-line", "is-terminal"]

## Like lean, but uses Rusts async implementations for networking.
##
Expand All @@ -77,7 +78,7 @@ small = ["pretty-cli", "prodash-render-line", "is-terminal"]
##
## Due to async client-networking not being implemented for most transports, this one supports only the 'git+tcp' and HTTP transport.
## It uses, however, a fully asynchronous networking implementation which can serve a real-world example on how to implement custom async transports.
lean-async = ["fast", "tracing", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-async-client", "prodash-render-line"]
lean-async = ["hashes", "fast", "tracing", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-async-client", "prodash-render-line"]

#! ### Package Maintainers
#! `*-control` features leave it to you to configure C libraries, involving choices for HTTP transport implementation.
Expand All @@ -88,6 +89,11 @@ lean-async = ["fast", "tracing", "pretty-cli", "gitoxide-core-tools", "gitoxide-
#! ### Building Blocks
#! Typical combinations of features of our dependencies, some of which are referred to in the `gitoxide` crate's code for conditional compilation.

## Provide support for all known hashes. If this isn't enabled, select an individual hash algorithms.
hashes = ["sha1"]
## Enable support for the SHA-1 hash throughout the `gix` crate.
sha1 = ["gix/sha1"]

## Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions.
## If disabled, the binary will be visibly smaller.
fast = ["gix/max-performance", "gix/comfort"]
Expand Down
3 changes: 3 additions & 0 deletions gitoxide-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ open = "5.0.0"

document-features = { version = "0.2.0", optional = true }

[dev-dependencies]
gix = { path = "../gix", default-features = false, features = ["sha1"] }

[package.metadata.docs.rs]
features = ["document-features", "blocking-client", "organize", "estimate-hours", "serde"]

Expand Down
6 changes: 4 additions & 2 deletions gix-archive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ doctest = false

[features]
default = ["tar", "tar_gz", "zip"]
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
sha1 = ["gix-worktree-stream/sha1", "gix-object/sha1"]

## Enable the `tar` archive format. It has support for all information, except for object ids.
tar = ["dep:tar", "dep:gix-path"]
Expand Down Expand Up @@ -48,11 +50,11 @@ gix-odb = { path = "../gix-odb" }
gix-worktree = { path = "../gix-worktree", default-features = false, features = [
"attributes",
] }
gix-hash = { path = "../gix-hash" }
gix-hash = { path = "../gix-hash", features = ["sha1"] }
gix-attributes = { path = "../gix-attributes" }
gix-object = { path = "../gix-object" }
gix-filter = { path = "../gix-filter" }

[package.metadata.docs.rs]
all-features = true
features = ["document-features"]
features = ["sha1", "document-features"]
15 changes: 15 additions & 0 deletions gix-blame/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ authors = ["Christoph Rüßler <christoph.ruessler@mailbox.org>", "Sebastian Thi
edition = "2021"
rust-version = "1.82"

[features]
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
sha1 = [
"gix-commitgraph/sha1",
"gix-diff/sha1",
"gix-hash/sha1",
"gix-object/sha1",
"gix-revwalk/sha1",
"gix-traverse/sha1",
"gix-worktree/sha1",
]

[dependencies]
gix-error = { version = "^0.2.0", path = "../gix-error" }
gix-commitgraph = { version = "^0.34.0", path = "../gix-commitgraph" }
Expand All @@ -33,3 +45,6 @@ gix-index = { path = "../gix-index" }
gix-odb = { path = "../gix-odb" }
gix-testtools = { path = "../tests/tools" }
pretty_assertions = "1.4.0"

[package.metadata.docs.rs]
features = ["sha1"]
6 changes: 4 additions & 2 deletions gix-commitgraph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ rust-version = "1.82"
doctest = false

[features]
## Enable support for the SHA-1 hash by enabling the respective feature in the `gix-hash` crate.
sha1 = ["gix-hash/sha1"]
## Data structures implement `serde::Serialize` and `serde::Deserialize`
serde = ["dep:serde", "gix-hash/serde", "bstr/serde"]

Expand All @@ -34,11 +36,11 @@ document-features = { version = "0.2.0", optional = true }
[dev-dependencies]
gix-testtools = { path = "../tests/tools" }
gix-date = { path = "../gix-date" }
gix-hash = { path = "../gix-hash", features = ["sha256"] }
gix-hash = { path = "../gix-hash", features = ["sha1", "sha256"] }

[package.metadata.docs.rs]
all-features = true
features = ["document-features"]
features = ["sha1", "document-features"]

[package.metadata.cargo-machete]
ignored = [
Expand Down
1 change: 1 addition & 0 deletions gix-commitgraph/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ memmap2 = "0.9.0"

[dependencies.gix-commitgraph]
path = ".."
features = ["sha1"]

# Prevent this from interfering with workspaces
[workspace]
Expand Down
5 changes: 4 additions & 1 deletion gix-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ rust-version = "1.82"
autotests = false

[features]
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
sha1 = ["gix-ref/sha1"]
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
serde = ["dep:serde", "bstr/serde", "gix-sec/serde", "gix-ref/serde", "gix-glob/serde", "gix-config-value/serde"]

Expand All @@ -38,6 +40,7 @@ document-features = { version = "0.2.0", optional = true }

[dev-dependencies]
criterion = "0.8.0"
gix-config = { path = ".", features = ["sha1"] }

[[bench]]
name = "large_config_file"
Expand All @@ -46,7 +49,7 @@ path = "./benches/large_config_file.rs"

[package.metadata.docs.rs]
all-features = true
features = ["document-features"]
features = ["sha1", "document-features"]

[package.metadata.cargo-machete]
ignored = [
Expand Down
1 change: 1 addition & 0 deletions gix-config/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ anyhow = "1.0.76"

[dependencies.gix-config]
path = ".."
features = ["sha1"]

# Prevent this from interfering with workspaces
[workspace]
Expand Down
5 changes: 4 additions & 1 deletion gix-diff/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ autotests = false

[features]
default = ["blob", "index"]
## Enable support for the SHA-1 hash by enabling the respective feature in the `gix-hash` crate.
sha1 = ["gix-hash/sha1"]
## Enable diffing of blobs using imara-diff.
blob = [
"dep:imara-diff",
Expand Down Expand Up @@ -71,10 +73,11 @@ document-features = { version = "0.2.0", optional = true }
[dev-dependencies]
criterion = "0.8.0"
imara-diff-v2 = { version = "0.2.0", package = "imara-diff" }
gix-hash = { path = "../gix-hash", features = ["sha1"] }

[package.metadata.docs.rs]
all-features = true
features = ["document-features"]
features = ["sha1", "document-features"]

[package.metadata.cargo-machete]
ignored = [
Expand Down
7 changes: 7 additions & 0 deletions gix-dir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ rust-version = "1.82"
doctest = false
test = false

[features]
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
sha1 = ["gix-discover/sha1", "gix-index/sha1", "gix-object/sha1", "gix-worktree/sha1"]

[dependencies]
gix-trace = { version = "^0.1.18", path = "../gix-trace" }
gix-index = { version = "^0.48.0", path = "../gix-index" }
Expand All @@ -33,3 +37,6 @@ thiserror = "2.0.18"
gix-testtools = { path = "../tests/tools" }
gix-fs = { path = "../gix-fs" }
pretty_assertions = "1.4.0"

[package.metadata.docs.rs]
features = ["sha1"]
7 changes: 7 additions & 0 deletions gix-discover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ rust-version = "1.82"
[lib]
doctest = false

[features]
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
sha1 = ["gix-ref/sha1"]

[dependencies]
gix-sec = { version = "^0.13.1", path = "../gix-sec" }
gix-path = { version = "^0.11.1", path = "../gix-path" }
Expand All @@ -36,3 +40,6 @@ defer = "0.2.1"

[target.'cfg(any(unix, windows))'.dev-dependencies]
tempfile = "3.24.0"

[package.metadata.docs.rs]
features = ["sha1"]
7 changes: 7 additions & 0 deletions gix-filter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ include = ["src/**/*", "LICENSE-*"]
[lib]
doctest = false

[features]
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
sha1 = ["gix-hash/sha1", "gix-object/sha1"]

[dependencies]
gix-hash = { version = "^0.22.1", path = "../gix-hash" }
gix-trace = { version = "^0.1.18", path = "../gix-trace" }
Expand All @@ -37,3 +41,6 @@ gix-testtools = { path = "../tests/tools" }
gix-worktree = { path = "../gix-worktree", default-features = false, features = ["attributes"] }

serial_test = { version = "3.3.1", default-features = false }

[package.metadata.docs.rs]
features = ["sha1"]
7 changes: 7 additions & 0 deletions gix-fsck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ rust-version = "1.82"
[lib]
doctest = false

[features]
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
sha1 = ["gix-hash/sha1", "gix-hashtable/sha1", "gix-object/sha1"]

[dependencies]
gix-hash = { version = "^0.22.1", path = "../gix-hash" }
gix-hashtable = { version = "^0.12.0", path = "../gix-hashtable" }
Expand All @@ -22,3 +26,6 @@ gix-object = { version = "^0.57.0", path = "../gix-object" }
[dev-dependencies]
gix-odb = { path = "../gix-odb" }
gix-testtools = { path = "../tests/tools" }

[package.metadata.docs.rs]
features = ["sha1"]
4 changes: 2 additions & 2 deletions gix-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ doctest = false
test = false

[features]
default = ["sha1"]
default = []
## Support for SHA1 hashes and digests.
sha1 = ["dep:sha1-checked"]
## Support for SHA256 hashes and digests.
Expand All @@ -40,4 +40,4 @@ gix-testtools = { path = "../tests/tools" }

[package.metadata.docs.rs]
all-features = true
features = ["document-features"]
features = ["sha1", "document-features"]
10 changes: 10 additions & 0 deletions gix-hashtable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ rust-version = "1.82"
[lib]
doctest = false

[features]
## Enable support for the SHA-1 hash by enabling the respective feature in the `gix-hash` crate.
sha1 = ["gix-hash/sha1"]

[dependencies]
parking_lot = "0.12.4"
hashbrown = { version = "0.16.0", default-features = false, features = ["inline-more"] }
gix-hash = { version = "^0.22.0", path = "../gix-hash" }

[dev-dependencies]
gix-hash = { path = "../gix-hash", features = ["sha1"] }

[package.metadata.docs.rs]
features = ["sha1"]
5 changes: 4 additions & 1 deletion gix-index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ doctest = false
test = true

[features]
## Enable support for the SHA-1 hash by enabling the respective feature in the `gix-hash` crate.
sha1 = ["gix-hash/sha1"]
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
serde = ["dep:serde", "smallvec/serde", "gix-hash/serde"]

Expand Down Expand Up @@ -59,6 +61,7 @@ libc = { version = "0.2.180" }

[dev-dependencies]
gix-testtools = { path = "../tests/tools" }
gix-hash = { path = "../gix-hash", features = ["sha1", "sha256"] }

[package.metadata.docs.rs]
features = ["document-features", "serde"]
features = ["sha1", "document-features", "serde"]
Loading
Loading