Skip to content

Commit e3eedd8

Browse files
committed
Remove dep reqwest from gix
Instead forward reqwest feature defined in gix-transport Signed-off-by: Jiahao XU <[email protected]>
1 parent e304369 commit e3eedd8

File tree

3 files changed

+133
-40
lines changed

3 files changed

+133
-40
lines changed

Cargo.lock

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

gix-transport/Cargo.toml

+36-6
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,42 @@ default = []
2222
## If set, blocking implementations of the typical git transports become available in `crate::client`
2323
blocking-client = ["gix-packetline/blocking-io"]
2424
## Implies `blocking-client`, and adds support for the http and https transports.
25-
http-client = ["base64", "gix-features/io-pipe", "blocking-client", "gix-credentials"]
25+
http-client = [
26+
"base64",
27+
"gix-features/io-pipe",
28+
"blocking-client",
29+
"gix-credentials",
30+
]
2631
## Implies `http-client`, and adds support for the http and https transports using the Rust bindings for `libcurl`.
2732
http-client-curl = ["curl", "http-client"]
2833
### Implies `http-client` and adds support for http and https transports using the blocking version of `reqwest`.
2934
http-client-reqwest = ["reqwest", "http-client"]
35+
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
36+
http-client-reqwest-rust-tls = ["http-client-reqwest", "reqwest/rustls-tls"]
37+
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
38+
## This also makes use of `trust-dns` to avoid `getaddrinfo`, but note it comes with its own problems.
39+
http-client-reqwest-rust-tls-trust-dns = [
40+
"http-client-reqwest",
41+
"reqwest/rustls-tls",
42+
"reqwest/trust-dns",
43+
]
44+
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `native-tls` crate.
45+
http-client-reqwest-native-tls = ["http-client-reqwest", "reqwest/default-tls"]
3046
## If set, an async implementations of the git transports becomes available in `crate::client`.
3147
## Suitable for implementing your own transports while using git's way of communication, typically in conjunction with a custom server.
3248
## **Note** that the _blocking_ client has a wide range of available transports, with the _async_ version of it supporting only the TCP based `git` transport leaving you
3349
## with the responsibility to providing such an implementation of `futures-io::AsyncRead/AsyncWrite` yourself.
34-
async-client = ["gix-packetline/async-io", "async-trait", "futures-lite", "futures-io", "pin-project-lite"]
50+
async-client = [
51+
"gix-packetline/async-io",
52+
"async-trait",
53+
"futures-lite",
54+
"futures-io",
55+
"pin-project-lite",
56+
]
3557

3658
#! ### Other
3759
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
38-
serde= ["dep:serde"]
60+
serde = ["dep:serde"]
3961

4062
[[test]]
4163
name = "blocking-transport"
@@ -61,8 +83,14 @@ gix-packetline = { version = "^0.17.5", path = "../gix-packetline" }
6183
gix-credentials = { version = "^0.24.2", path = "../gix-credentials", optional = true }
6284
gix-quote = { version = "^0.4.12", path = "../gix-quote" }
6385

64-
serde = { version = "1.0.114", optional = true, default-features = false, features = ["std", "derive"]}
65-
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"] }
86+
serde = { version = "1.0.114", optional = true, default-features = false, features = [
87+
"std",
88+
"derive",
89+
] }
90+
bstr = { version = "1.3.0", default-features = false, features = [
91+
"std",
92+
"unicode",
93+
] }
6694
thiserror = "1.0.26"
6795

6896
# for async-client
@@ -87,7 +115,9 @@ async-std = { version = "1.12.0", optional = true }
87115
document-features = { version = "0.2.0", optional = true }
88116

89117
[dev-dependencies]
90-
gix-pack = { path = "../gix-pack", default-features = false, features = ["streaming-input"] }
118+
gix-pack = { path = "../gix-pack", default-features = false, features = [
119+
"streaming-input",
120+
] }
91121
gix-hash = { path = "../gix-hash" }
92122
async-std = { version = "1.9.0", features = ["attributes"] }
93123
maybe-async = "0.2.6"

gix/Cargo.toml

+97-33
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,25 @@ default = ["max-performance-safe", "comfort", "basic", "extras"]
5151
basic = ["blob-diff", "revision", "index"]
5252

5353
## Various additional features and capabilities that are not necessarily part of what most users would need.
54-
extras = ["worktree-stream", "worktree-archive", "revparse-regex", "mailmap", "excludes", "attributes", "worktree-mutation", "credentials", "interrupt", "status", "dirwalk"]
54+
extras = [
55+
"worktree-stream",
56+
"worktree-archive",
57+
"revparse-regex",
58+
"mailmap",
59+
"excludes",
60+
"attributes",
61+
"worktree-mutation",
62+
"credentials",
63+
"interrupt",
64+
"status",
65+
"dirwalk",
66+
]
5567

5668
## Various progress-related features that improve the look of progress message units.
57-
comfort = ["gix-features/progress-unit-bytes", "gix-features/progress-unit-human-numbers"]
69+
comfort = [
70+
"gix-features/progress-unit-bytes",
71+
"gix-features/progress-unit-human-numbers",
72+
]
5873

5974
#! #### Components
6075
#!
@@ -87,7 +102,15 @@ worktree-mutation = ["attributes", "dep:gix-worktree-state"]
87102
excludes = ["dep:gix-ignore", "dep:gix-worktree", "index"]
88103

89104
## Query attributes and excludes. Enables access to pathspecs, worktree checkouts, filter-pipelines and submodules.
90-
attributes = ["excludes", "dep:gix-filter", "dep:gix-pathspec", "dep:gix-attributes", "dep:gix-submodule", "gix-worktree?/attributes", "command"]
105+
attributes = [
106+
"excludes",
107+
"dep:gix-filter",
108+
"dep:gix-pathspec",
109+
"dep:gix-attributes",
110+
"dep:gix-submodule",
111+
"gix-worktree?/attributes",
112+
"command",
113+
]
91114

92115
## Add support for mailmaps, as way of determining the final name of commmiters and authors.
93116
mailmap = ["dep:gix-mailmap", "revision"]
@@ -119,24 +142,57 @@ worktree-archive = ["gix-archive", "worktree-stream", "attributes"]
119142
#! Making a choice here also affects which crypto-library ends up being used.
120143

121144
## Make `gix-protocol` available along with an async client.
122-
async-network-client = ["gix-protocol/async-client", "gix-pack/streaming-input", "attributes", "credentials"]
145+
async-network-client = [
146+
"gix-protocol/async-client",
147+
"gix-pack/streaming-input",
148+
"attributes",
149+
"credentials",
150+
]
123151
## Use this if your crate uses `async-std` as runtime, and enable basic runtime integration when connecting to remote servers via the `git://` protocol.
124-
async-network-client-async-std = ["async-std", "async-network-client", "gix-transport/async-std"]
152+
async-network-client-async-std = [
153+
"async-std",
154+
"async-network-client",
155+
"gix-transport/async-std",
156+
]
125157
## Make `gix-protocol` available along with a blocking client, providing access to the `file://`, `git://` and `ssh://` transports.
126-
blocking-network-client = ["gix-protocol/blocking-client", "gix-pack/streaming-input", "attributes", "credentials"]
158+
blocking-network-client = [
159+
"gix-protocol/blocking-client",
160+
"gix-pack/streaming-input",
161+
"attributes",
162+
"credentials",
163+
]
127164
## Stacks with `blocking-network-client` to provide support for HTTP/S using **curl**, and implies blocking networking as a whole, making the `https://` transport available.
128-
blocking-http-transport-curl = ["blocking-network-client", "gix-transport/http-client-curl"]
165+
blocking-http-transport-curl = [
166+
"blocking-network-client",
167+
"gix-transport/http-client-curl",
168+
]
129169
## Stacks with `blocking-http-transport-curl` and also enables the `rustls` backend to avoid `openssl`.
130-
blocking-http-transport-curl-rustls = ["blocking-http-transport-curl", "dep:curl", "curl?/rustls"]
170+
blocking-http-transport-curl-rustls = [
171+
"blocking-http-transport-curl",
172+
"dep:curl",
173+
"curl?/rustls",
174+
]
131175
## Stacks with `blocking-network-client` to provide support for HTTP/S using **reqwest**, and implies blocking networking as a whole, making the `https://` transport available.
132-
blocking-http-transport-reqwest = ["blocking-network-client", "gix-transport/http-client-reqwest"]
176+
blocking-http-transport-reqwest = [
177+
"blocking-network-client",
178+
"gix-transport/http-client-reqwest",
179+
]
133180
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
134-
blocking-http-transport-reqwest-rust-tls = ["blocking-http-transport-reqwest", "reqwest/rustls-tls"]
181+
blocking-http-transport-reqwest-rust-tls = [
182+
"blocking-http-transport-reqwest",
183+
"gix-transport/http-client-reqwest-rust-tls",
184+
]
135185
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `rustls` crate.
136186
## This also makes use of `trust-dns` to avoid `getaddrinfo`, but note it comes with its own problems.
137-
blocking-http-transport-reqwest-rust-tls-trust-dns = ["blocking-http-transport-reqwest", "reqwest/rustls-tls", "reqwest/trust-dns"]
187+
blocking-http-transport-reqwest-rust-tls-trust-dns = [
188+
"blocking-http-transport-reqwest",
189+
"gix-transport/http-client-reqwest-rust-tls-trust-dns",
190+
]
138191
## Stacks with `blocking-http-transport-reqwest` and enables `https://` via the `native-tls` crate.
139-
blocking-http-transport-reqwest-native-tls = ["blocking-http-transport-reqwest", "reqwest/default-tls"]
192+
blocking-http-transport-reqwest-native-tls = [
193+
"blocking-http-transport-reqwest",
194+
"gix-transport/http-client-reqwest-native-tls",
195+
]
140196

141197

142198
#! #### Performance
@@ -147,20 +203,13 @@ blocking-http-transport-reqwest-native-tls = ["blocking-http-transport-reqwest",
147203
## Activate features that maximize performance, like using threads, but leave everything else that might affect compatibility out to allow users more fine-grained
148204
## control over performance features like which `zlib*` implementation to use.
149205
## No C toolchain is involved.
150-
max-control = [
151-
"parallel",
152-
"pack-cache-lru-static",
153-
"pack-cache-lru-dynamic",
154-
]
206+
max-control = ["parallel", "pack-cache-lru-static", "pack-cache-lru-dynamic"]
155207

156208
## Activate features that maximize performance, like usage of threads, `and access to caching in object databases, skipping the ones known to cause compile failures
157209
## on some platforms.
158210
## Note that this configuration still uses a pure Rust zlib implementation which isn't the fastest compared to its C-alternatives.
159211
## No C toolchain is involved.
160-
max-performance-safe = [
161-
"max-control",
162-
"parallel-walkdir"
163-
]
212+
max-performance-safe = ["max-control", "parallel-walkdir"]
164213

165214
## If set, walkdir iterators will be multi-threaded which affects the listing of loose objects and references.
166215
## Note, however, that this will use `rayon` under the hood and spawn threads for each traversal to avoid a global rayon thread pool.
@@ -215,7 +264,8 @@ zlib-stock = ["gix-features/zlib-stock"]
215264
verbose-object-parsing-errors = ["gix-object/verbose-object-parsing-errors"]
216265

217266
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
218-
serde = ["dep:serde",
267+
serde = [
268+
"dep:serde",
219269
"gix-pack/serde",
220270
"gix-object/serde",
221271
"gix-protocol?/serde",
@@ -230,7 +280,8 @@ serde = ["dep:serde",
230280
"gix-revision/serde",
231281
"gix-worktree?/serde",
232282
"gix-commitgraph/serde",
233-
"gix-credentials?/serde"]
283+
"gix-credentials?/serde",
284+
]
234285

235286
## Re-export the progress tree root which allows to obtain progress from various functions which take `impl gix::Progress`.
236287
## Applications which want to display progress will probably need this implementation.
@@ -240,7 +291,6 @@ progress-tree = ["prodash/progress-tree"]
240291
cache-efficiency-debug = ["gix-features/cache-efficiency-debug"]
241292

242293

243-
244294
[dependencies]
245295
gix-macros = { version = "^0.1.4", path = "../gix-macros" }
246296
gix-utils = { version = "^0.1.11", path = "../gix-utils" }
@@ -261,7 +311,9 @@ gix-odb = { version = "^0.59.0", path = "../gix-odb" }
261311
gix-hash = { version = "^0.14.2", path = "../gix-hash" }
262312
gix-object = { version = "^0.42.1", path = "../gix-object" }
263313
gix-actor = { version = "^0.31.1", path = "../gix-actor" }
264-
gix-pack = { version = "^0.49.0", path = "../gix-pack", default-features = false, features = ["object-cache-dynamic"] }
314+
gix-pack = { version = "^0.49.0", path = "../gix-pack", default-features = false, features = [
315+
"object-cache-dynamic",
316+
] }
265317
gix-revision = { version = "^0.27.0", path = "../gix-revision", default-features = false }
266318
gix-revwalk = { version = "^0.13.0", path = "../gix-revwalk" }
267319
gix-negotiate = { version = "^0.13.0", path = "../gix-negotiate", optional = true }
@@ -271,7 +323,10 @@ gix-url = { version = "^0.27.2", path = "../gix-url" }
271323
gix-traverse = { version = "^0.38.0", path = "../gix-traverse" }
272324
gix-diff = { version = "^0.42.0", path = "../gix-diff", default-features = false }
273325
gix-mailmap = { version = "^0.23.0", path = "../gix-mailmap", optional = true }
274-
gix-features = { version = "^0.38.1", path = "../gix-features", features = ["progress", "once_cell"] }
326+
gix-features = { version = "^0.38.1", path = "../gix-features", features = [
327+
"progress",
328+
"once_cell",
329+
] }
275330
gix-trace = { version = "^0.1.8", path = "../gix-trace" }
276331

277332
gix-glob = { version = "^0.16.2", path = "../gix-glob" }
@@ -286,7 +341,9 @@ gix-hashtable = { version = "^0.5.2", path = "../gix-hashtable" }
286341
gix-commitgraph = { version = "^0.24.2", path = "../gix-commitgraph" }
287342
gix-pathspec = { version = "^0.7.2", path = "../gix-pathspec", optional = true }
288343
gix-submodule = { version = "^0.10.0", path = "../gix-submodule", optional = true }
289-
gix-status = { version = "^0.8.0", path = "../gix-status", optional = true, features = ["worktree-rewrites"] }
344+
gix-status = { version = "^0.8.0", path = "../gix-status", optional = true, features = [
345+
"worktree-rewrites",
346+
] }
290347
gix-command = { version = "^0.3.6", path = "../gix-command", optional = true }
291348

292349
gix-worktree-stream = { version = "^0.11.0", path = "../gix-worktree-stream", optional = true }
@@ -301,7 +358,9 @@ prodash = { workspace = true, optional = true, features = ["progress-tree"] }
301358
once_cell = "1.14.0"
302359
signal-hook = { version = "0.3.9", default-features = false, optional = true }
303360
thiserror = "1.0.26"
304-
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
361+
serde = { version = "1.0.114", optional = true, default-features = false, features = [
362+
"derive",
363+
] }
305364
smallvec = "1.9.0"
306365
async-std = { version = "1.12.0", optional = true }
307366

@@ -312,10 +371,9 @@ curl = { workspace = true, optional = true }
312371
##
313372
## If disabled, the text will be search verbatim in any portion of the commit message, similar to
314373
## how a simple unanchored regex of only 'normal' characters would work.
315-
regex = { version = "1.6.0", optional = true, default-features = false, features = ["std"] }
316-
317-
# For internal use to allow pure-Rust builds without openssl.
318-
reqwest = { workspace = true, optional = true }
374+
regex = { version = "1.6.0", optional = true, default-features = false, features = [
375+
"std",
376+
] }
319377

320378
# for `interrupt` module
321379
parking_lot = "0.12.1"
@@ -332,4 +390,10 @@ serial_test = { version = "2.0.0", default-features = false }
332390
async-std = { version = "1.12.0", features = ["attributes"] }
333391

334392
[package.metadata.docs.rs]
335-
features = ["document-features", "max-performance", "blocking-network-client", "blocking-http-transport-curl", "serde"]
393+
features = [
394+
"document-features",
395+
"max-performance",
396+
"blocking-network-client",
397+
"blocking-http-transport-curl",
398+
"serde",
399+
]

0 commit comments

Comments
 (0)