Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16a6fc4

Browse files
codexByron
andcommitted
Cleanup sha1 feature in gix to just set what's needed.
These features must only be set if the crate is actually using it with `cfg!(feature = "shaX")`, and only two crates do that right now. It's needed also when compilation would fail if no hash feature is selected. Co-authored-by: Sebastian Thiel <[email protected]>
1 parent 09b982c commit 16a6fc4

16 files changed

Lines changed: 27 additions & 45 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ lean-async = ["hashes", "fast", "tracing", "pretty-cli", "gitoxide-core-tools",
9292
#! Typical combinations of features of our dependencies, some of which are referred to in the `gitoxide` crate's code for conditional compilation.
9393

9494
## Provide support for all known hashes. If this isn't enabled, select an individual hash algorithms.
95-
hashes = ["sha1"]
95+
hashes = ["sha1", "sha256"]
9696
## Enable support for the SHA-1 hash throughout the `gix` crate.
9797
sha1 = ["gix/sha1"]
98+
## Enable support for the SHA-256 hash throughout the `gix` crate.
99+
sha256 = ["gix/sha256"]
98100

99101
## Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions.
100102
## If disabled, the binary will be visibly smaller.

gix-archive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ doctest = false
1717
[features]
1818
default = ["tar", "tar_gz", "zip"]
1919
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
20-
sha1 = ["gix-worktree-stream/sha1", "gix-object/sha1"]
20+
sha1 = ["gix-worktree-stream/sha1"]
2121
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
2222
sha256 = ["gix-worktree-stream/sha256"]
2323

gix-blame/Cargo.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@ include = ["/src/**/*", "/LICENSE-*"]
1313

1414
[features]
1515
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
16-
sha1 = [
17-
"gix-commitgraph/sha1",
18-
"gix-diff/sha1",
19-
"gix-hash/sha1",
20-
"gix-object/sha1",
21-
"gix-revwalk/sha1",
22-
"gix-traverse/sha1",
23-
"gix-worktree/sha1",
24-
]
16+
sha1 = ["gix-hash/sha1"]
2517
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
2618
sha256 = ["gix-hash/sha256"]
2719

gix-config/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ autotests = false
1717
[features]
1818
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
1919
sha1 = ["gix-ref/sha1"]
20+
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
21+
sha256 = ["gix-ref/sha256"]
2022
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
2123
serde = ["dep:serde", "bstr/serde", "gix-sec/serde", "gix-ref/serde", "gix-glob/serde", "gix-config-value/serde"]
2224

gix-dir/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ test = false
1717

1818
[features]
1919
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
20-
sha1 = ["gix-discover/sha1", "gix-index/sha1", "gix-object/sha1", "gix-worktree/sha1"]
20+
sha1 = ["gix-index/sha1"]
21+
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
22+
sha256 = ["gix-index/sha256"]
2123

2224
[dependencies]
2325
gix-trace = { version = "^0.1.19", path = "../gix-trace" }

gix-discover/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ doctest = true
1717
[features]
1818
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
1919
sha1 = ["gix-ref/sha1"]
20+
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
21+
sha256 = ["gix-ref/sha256"]
2022

2123
[dependencies]
2224
gix-sec = { version = "^0.14.0", path = "../gix-sec" }

gix-filter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ doctest = false
1616

1717
[features]
1818
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
19-
sha1 = ["gix-hash/sha1", "gix-object/sha1"]
19+
sha1 = ["gix-hash/sha1"]
2020
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
2121
sha256 = ["gix-hash/sha256"]
2222

gix-fsck/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ doctest = false
1616

1717
[features]
1818
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
19-
sha1 = ["gix-hash/sha1", "gix-hashtable/sha1", "gix-object/sha1"]
19+
sha1 = ["gix-hash/sha1"]
2020
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
2121
sha256 = ["gix-hash/sha256"]
2222

gix-negotiate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test = false
1717

1818
[features]
1919
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
20-
sha1 = ["gix-commitgraph/sha1", "gix-hash/sha1", "gix-object/sha1", "gix-revwalk/sha1"]
20+
sha1 = ["gix-hash/sha1"]
2121
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
2222
sha256 = ["gix-hash/sha256"]
2323

gix-revwalk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ doctest = false
1616

1717
[features]
1818
## Enable support for the SHA-1 hash by forwarding the feature to dependencies.
19-
sha1 = ["gix-commitgraph/sha1", "gix-hash/sha1", "gix-hashtable/sha1", "gix-object/sha1"]
19+
sha1 = ["gix-hash/sha1"]
2020
## Enable support for the SHA-256 hash by forwarding the feature to dependencies.
2121
sha256 = ["gix-hash/sha256"]
2222

0 commit comments

Comments
 (0)