Skip to content

Commit 03ff188

Browse files
committed
Merge branch 'max-pure'
2 parents 4c1685b + c7cba33 commit 03ff188

File tree

11 files changed

+333
-138
lines changed

11 files changed

+333
-138
lines changed

Diff for: Cargo.lock

+287-115
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+6-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ lean-async = ["fast", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-async-
5757
small = ["pretty-cli", "git-features/rustsha1", "git-features/zlib-rust-backend", "prodash-render-line", "atty" ]
5858

5959
## Makes the crate execute as fast as possible without pulling in C libraries, while keeping everything else minimal akin to the `small` build.
60-
max-pure = ["pretty-cli", "git-features/rustsha1", "git-features/zlib-rust-backend", "prodash-render-line", "prodash-render-tui", "git-repository/max-performance-safe", "http-client-curl", "gitoxide-core-blocking-client", "gitoxide-core-tools", "prodash/render-line-autoconfigure" ]
60+
max-pure = ["pretty-cli", "git-features/rustsha1", "git-features/zlib-rust-backend", "prodash-render-line", "prodash-render-tui", "git-repository/max-performance-safe", "http-client-reqwest", "gitoxide-core-blocking-client", "gitoxide-core-tools", "prodash/render-line-autoconfigure" ]
6161

6262
#! ### `gitoxide-core` Configuration
6363

@@ -69,8 +69,10 @@ gitoxide-core-tools = ["gitoxide-core/organize", "gitoxide-core/estimate-hours"]
6969

7070
## Use blocking client networking.
7171
gitoxide-core-blocking-client = ["gitoxide-core/blocking-client"]
72-
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) at the expense of compile times and binary size.
73-
http-client-curl = ["git-repository/blocking-http-transport"]
72+
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) using **curl**.
73+
http-client-curl = ["git-repository/blocking-http-transport-curl"]
74+
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) using **reqwest**.
75+
http-client-reqwest = ["git-repository/blocking-http-transport-reqwest", "reqwest-for-configuration-only", "reqwest-for-configuration-only/rustls-tls", "reqwest-for-configuration-only/trust-dns"]
7476
## Use async client networking.
7577
gitoxide-core-async-client = ["gitoxide-core/async-client", "futures-lite"]
7678

@@ -85,6 +87,7 @@ anyhow = "1.0.42"
8587
gitoxide-core = { version = "^0.20.0", path = "gitoxide-core" }
8688
git-features = { version = "^0.23.1", path = "git-features" }
8789
git-repository = { version = "^0.28.0", path = "git-repository", default-features = false }
90+
reqwest-for-configuration-only = { package = "reqwest", version = "0.11.13", default-features = false, optional = true }
8891

8992
clap = { version = "3.2.5", features = ["derive", "cargo"] }
9093
prodash = { version = "21", optional = true, default-features = false }

Diff for: Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ check: ## Build all code in suitable configurations
127127
cd git-repository && cargo check --no-default-features --features async-network-client \
128128
&& cargo check --no-default-features --features async-network-client-async-std \
129129
&& cargo check --no-default-features --features blocking-network-client \
130-
&& cargo check --no-default-features --features blocking-network-client,blocking-http-transport \
130+
&& cargo check --no-default-features --features blocking-http-transport-curl \
131+
&& cargo check --no-default-features --features blocking-http-transport-reqwest \
131132
&& cargo check --no-default-features --features max-performance \
132133
&& cargo check --no-default-features --features max-performance-safe \
133134
&& cargo check --no-default-features
@@ -178,7 +179,7 @@ journey-tests: always ## run journey tests (max)
178179
./tests/journey.sh target/debug/ein target/debug/gix $(jtt) max
179180

180181
journey-tests-pure: always ## run journey tests (max-pure)
181-
cargo build
182+
cargo build --no-default-features --features max-pure
182183
cargo build --package git-testtools --bin jtt
183184
./tests/journey.sh target/debug/ein target/debug/gix $(jtt) max-pure
184185

Diff for: deny.toml

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ allow = [
4141
"MIT",
4242
"ISC",
4343
"Unicode-DFS-2016",
44+
"LicenseRef-ring"
4445
]
4546
# Lint level for licenses considered copyleft
4647
copyleft = "allow"
@@ -61,3 +62,12 @@ confidence-threshold = 0.8
6162
[bans]
6263
# Lint level for when multiple versions of the same crate are detected
6364
multiple-versions = "allow"
65+
66+
67+
[[licenses.clarify]]
68+
name = "ring"
69+
expression = "LicenseRef-ring"
70+
license-files = [
71+
{ path = "LICENSE", hash = 0xbd0eed23 },
72+
]
73+

Diff for: git-repository/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ async-network-client = ["git-protocol/async-client"]
3636
async-network-client-async-std = ["async-std", "async-network-client", "git-transport/async-std"]
3737
## Make `git-protocol` available along with a blocking client.
3838
blocking-network-client = ["git-protocol/blocking-client"]
39-
## Stacks with `blocking-network-client` to provide support for HTTP/S, and implies blocking networking as a whole.
40-
blocking-http-transport = ["git-transport/http-client-curl"]
39+
## Stacks with `blocking-network-client` to provide support for HTTP/S using **curl**, and implies blocking networking as a whole.
40+
blocking-http-transport-curl = ["blocking-network-client", "git-transport/http-client-curl"]
41+
## Stacks with `blocking-network-client` to provide support for HTTP/S using **reqwest**, and implies blocking networking as a whole.
42+
blocking-http-transport-reqwest = ["blocking-network-client", "git-transport/http-client-reqwest"]
4143

4244

4345
#! ### Other

Diff for: git-repository/src/repository/config/transport.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ impl crate::Repository {
1616

1717
match &url.scheme {
1818
Http | Https => {
19-
#[cfg(not(feature = "blocking-http-transport"))]
19+
#[cfg(not(any(
20+
feature = "blocking-http-transport-reqwest",
21+
feature = "blocking-http-transport-curl"
22+
)))]
2023
{
2124
Ok(None)
2225
}
23-
#[cfg(feature = "blocking-http-transport")]
26+
#[cfg(any(
27+
feature = "blocking-http-transport-reqwest",
28+
feature = "blocking-http-transport-curl"
29+
))]
2430
{
2531
use crate::bstr::ByteVec;
2632
use crate::config::cache::util::{ApplyLeniency, ApplyLeniencyDefault};

Diff for: git-repository/tests/repository/config/transport_options.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
#[cfg(feature = "blocking-http-transport")]
1+
#[cfg(any(
2+
feature = "blocking-http-transport-reqwest",
3+
feature = "blocking-http-transport-curl"
4+
))]
25
mod http {
36
use git_repository as git;
47

Diff for: git-transport/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ base64 = { version = "0.13.0", optional = true }
7575
curl = { version = "0.4", optional = true, features = ["static-curl", "static-ssl", "zlib-ng-compat"] }
7676

7777
# for http-client-reqwest
78-
reqwest = { version = "0.11.12", optional = true, features = ["blocking"] }
78+
reqwest = { version = "0.11.12", optional = true, default-features = false, features = ["blocking"] }
7979

8080
## If used in conjunction with `async-client`, the `connect()` method will become available along with supporting the git protocol over TCP,
8181
## where the TCP stream is created using this crate.

Diff for: git-transport/src/client/blocking_io/http/reqwest/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ pub struct Remote {
1010
config: crate::client::http::Options,
1111
}
1212

13+
/// A function to configure a single request prior to sending it, support most complex configuration beyond what's possible with
14+
/// basic `git` http configuration.
15+
pub type ConfigureRequestFn = dyn FnMut(&mut reqwest::blocking::Request) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>>
16+
+ Send
17+
+ Sync
18+
+ 'static;
19+
1320
/// Options to configure the reqwest HTTP handler.
1421
#[derive(Default)]
1522
pub struct Options {
1623
/// A function to configure the request that is about to be made.
17-
pub configure_request: Option<
18-
Box<
19-
dyn FnMut(&mut reqwest::blocking::Request) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>>
20-
+ Send
21-
+ Sync
22-
+ 'static,
23-
>,
24-
>,
24+
pub configure_request: Option<Box<ConfigureRequestFn>>,
2525
}
2626

2727
mod remote;

Diff for: tests/journey/gix.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ title "git-tempfile crate"
3838

3939
(when "running the example program to check order of signal handlers"
4040
it "fails as the process aborts" && {
41-
expect_run $ABORTED cargo run --example interrupt-handler-allows-graceful-shutdown
41+
expect_run $ABORTED cargo run --no-default-features --example interrupt-handler-allows-graceful-shutdown
4242
}
4343
it "cleans up the tempfile it created" && {
4444
expect_run $WITH_FAILURE test -e "example-file.tmp"

Diff for: tests/snapshots/plumbing/no-repo/pack/explode/broken-with-objects-dir-skip-checks-success-tree-miniz-oxide-max

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
│   └── 48234cfc7b4f0c9475d24d4c386783533a8034
3737
├── 88
3838
│   └── 58983d81b0eef76eb55d21a0d96b7b16846eca
39-
├── a2
40-
│   └── 9ebd0e0fcbcd2a0842dd44cc7c22a90a310a3a
4139
├── af
4240
│   └── 4f6405296dec699321ca59d48583ffa0323b0e
4341
├── b2
@@ -53,4 +51,4 @@
5351
└── e8
5452
└── 00b9c207e17f9b11e321cc1fba5dfe08af4222
5553

56-
26 directories, 27 files
54+
25 directories, 26 files

0 commit comments

Comments
 (0)