forked from GitoxideLabs/gitoxide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.toml
395 lines (351 loc) · 15.7 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
lints.workspace = true
[package]
name = "gitoxide"
description = "A command-line application for interacting with git repositories"
repository = "https://github.com/GitoxideLabs/gitoxide"
authors = ["Sebastian Thiel <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
version = "0.38.0"
default-run = "gix"
include = ["src/**/*", "/build.rs", "LICENSE-*", "README.md"]
resolver = "2"
[[bin]]
name = "ein"
path = "src/ein.rs"
doc = false
test = false
doctest = false
[[bin]]
name = "gix"
path = "src/gix.rs"
doc = false
test = false
doctest = false
[features]
default = ["max"]
#! ### Build Configuration
#! These combine common choices of building blocks to represent typical builds.
## Everything, all at once.
##
## As fast as possible, tracing, with TUI progress, progress line rendering with autoconfiguration, all transports based on their most mature implementation (HTTP), all `ein` tools, CLI colors and local-time support, JSON output, regex support for rev-specs.
## Can be amended with the `http-client-curl-rustls` feature to avoid `openssl` as backend.
max = ["max-control", "fast", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-blocking-client", "http-client-curl"]
## Like `max`, but only Rust is allowed.
##
## This is the most compatible build as it won't need a C compiler or C toolchains to build. It's also not the fastest as or the most feature-rich in terms of available
## transports as it 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", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "http-client-reqwest", "gitoxide-core-blocking-client"]
## Like `max`, but with more control for configuration. See the *Package Maintainers* headline for more information.
max-control = ["tracing", "fast-safe", "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", "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.
##
## Optimized for size, no parallelism thus much slower, progress line rendering.
small = ["pretty-cli", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "prodash-render-line", "is-terminal"]
## Like lean, but uses Rusts async implementations for networking.
##
## This build is more of a demonstration showing how async can work with `gitoxide`, which generally is blocking. This also means that the selection of async transports
## is very limited to only HTTP (without typical `git` configuration) and git over TCP like provided by the `git daemon`.
##
## As fast as possible, progress line rendering, less featureful HTTP (pure Rust) and only `git-daemon` support, all `ein` tools, CLI colors and local-time support, JSON output.
##
## 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"]
#! ### Package Maintainers
#! `*-control` features leave it to you to configure C libraries, involving choices for `zlib`, ! hashing and transport implementation.
#!
#! Additional features *can* be provided with `--features` and are handled by the [`gix-features` crate](https://docs.rs/gix-features/latest).
#! If nothing else is specified, the Rust implementation is used. ! Note that only one feature of each section can be enabled at a time.
#!
#! * **zlib**
#! - `gix-features/zlib-ng`
#! - `gix-features/zlib-ng-compat`
#! - `gix-features/zlib-stock`
#! - `gix-features/zlib-rust-backend` (*default if no choice is made*)
#! * **sha1**
#! - `gix-features/fast-sha1`
#! - `gix-features/rustsha1` (*default if no choice is made*)
#! * **HTTP** - see the *Building Blocks for mutually exclusive networking* headline
#!
#! #### Examples
#!
#! * `cargo build --release --no-default-features --features max-control,gix-features/zlib-stock,gitoxide-core-blocking-client,http-client-curl`
#! - Create a build just like `max`, but using the stock `zlib` library instead of `zlib-ng`
#! * `cargo build --release --no-default-features --features max-control,http-client-reqwest,gitoxide-core-blocking-client,gix-features/fast-sha1`
#! - Create a build just like `max-pure`, but with faster hashing due to `fast-sha1`.
#! ### Building Blocks
#! Typical combinations of features of our dependencies, some of which are referred to in the `gitoxide` crate's code for conditional compilation.
## Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions
## as well as fast, hardware accelerated hashing, along with a faster zlib backend.
## If disabled, the binary will be visibly smaller.
fast = ["gix/max-performance", "gix/comfort"]
## Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions
## as well as fast, hardware accelerated hashing, along with a faster zlib backend.
## If disabled, the binary will be visibly smaller.
fast-safe = ["gix/max-performance-safe", "gix/comfort"]
## Enable tracing in `gitoxide-core`.
tracing = ["dep:tracing-forest", "dep:tracing-subscriber", "dep:tracing", "gix-features/tracing", "gix-features/tracing-detail"]
## Use `clap` 3.0 to build the prettiest, best documented and most user-friendly CLI at the expense of binary size.
## Provides a terminal user interface for detailed and exhaustive progress.
## Provides a line renderer for leaner progress display, without the need for a full-blown TUI.
pretty-cli = ["gitoxide-core/serde", "prodash/progress-tree", "prodash/progress-tree-log", "prodash/local-time", "env_logger/humantime", "env_logger/color", "env_logger/auto-color"]
## The `--verbose` flag will be powered by an interactive progress mechanism that doubles as log as well as interactive progress
## that appears after a short duration.
prodash-render-line-crossterm = ["prodash-render-line", "prodash/render-line-crossterm", "prodash/signal-hook", "is-terminal", "crosstermion"]
## Progress reporting with a TUI, can then be enabled with the `--progress` flag.
prodash-render-tui = ["prodash/render-tui", "prodash/render-tui-crossterm", "gix/progress-tree", "futures-lite"]
## Progress reporting by visually drawing lines into the terminal without switching to an alternate window.
prodash-render-line = ["prodash/render-line", "prodash-render-line-crossterm", "gix/progress-tree"]
## Prints statistical information to inform about cache efficiency when those are dropped.
## Use this as a way to understand if bigger caches actually produce greater yiedls.
cache-efficiency-debug = ["gix-features/cache-efficiency-debug"]
## A way to enable most `gitoxide-core` tools found in `ein tools`, namely `organize` and `estimate hours`.
gitoxide-core-tools = ["gitoxide-core/organize", "gitoxide-core/estimate-hours", "gitoxide-core-tools-archive", "gitoxide-core-tools-clean"]
## A program to perform analytics on a `git` repository, using an auto-maintained sqlite database
gitoxide-core-tools-query = ["gitoxide-core/query"]
## A program to run algorithms on a corpus of repositories, recording each run for later comparison.
gitoxide-core-tools-corpus = ["gitoxide-core/corpus"]
## A sub-command to generate archive from virtual worktree checkouts.
gitoxide-core-tools-archive = ["gitoxide-core/archive"]
## A sub-command to clean the worktree from untracked and ignored files.
gitoxide-core-tools-clean = ["gitoxide-core/clean"]
#! ### Building Blocks for mutually exclusive networking
#! Blocking and async features are mutually exclusive and cause a compile-time error. This also means that `cargo … --all-features` will fail.
#! Within each section, features can be combined.
#!
#! #### Blocking
#! The backends are mutually exclusive, e.g. choose either `curl` or `request`.
#!
## Use blocking client networking.
gitoxide-core-blocking-client = ["gitoxide-core/blocking-client"]
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) using **curl**.
http-client-curl = ["gix/blocking-http-transport-curl"]
## Implies `http-client-curl` and configures `curl` to use the `rust-tls` backend.
http-client-curl-rustls = ["gix/blocking-http-transport-curl-rustls"]
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) using **reqwest**.
http-client-reqwest = ["gix/blocking-http-transport-reqwest-rust-tls"]
#! #### Async
#!
## Use async client networking.
gitoxide-core-async-client = ["gitoxide-core/async-client", "futures-lite"]
[dependencies]
anyhow = "1.0.42"
gitoxide-core = { version = "^0.42.0", path = "gitoxide-core" }
gix-features = { version = "^0.39.0", path = "gix-features" }
gix = { version = "^0.67.0", path = "gix", default-features = false }
clap = { version = "4.1.1", features = ["derive", "cargo"] }
clap_complete = "4.4.3"
prodash = { version = "29.0.0", optional = true }
is-terminal = { version = "0.4.0", optional = true }
env_logger = { version = "0.10.0", default-features = false }
crosstermion = { version = "0.14.0", optional = true, default-features = false }
futures-lite = { version = "2.1.0", optional = true }
# for 'tracing'
tracing-forest = { version = "0.1.5", features = ["serde"], optional = true }
tracing-subscriber = { version = "0.3.17", optional = true }
tracing = { version = "0.1.37", optional = true }
# for config-tree
terminal_size = "0.3.0"
# Avoid pre-compiled binaries, see https://github.com/serde-rs/serde/issues/2538 and https://github.com/serde-rs/serde/pull/2590
serde_derive = ">=1.0.185"
once_cell = "1.18.0"
document-features = { version = "0.2.0", optional = true }
[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3
gix-object = { opt-level = 3 }
gix-ref = { opt-level = 3 }
#gix-pack = { opt-level = 3 }
gix-hash = { opt-level = 3 }
gix-actor = { opt-level = 3 }
gix-config = { opt-level = 3 }
miniz_oxide = { opt-level = 3 }
sha1 = { opt-level = 3 }
sha1_smol = { opt-level = 3 }
[profile.release]
overflow-checks = false
lto = "thin"
# This bloats files but assures destructors are called, important for tempfiles. One day I hope we
# can wire up the 'abrt' signal handler so tempfiles will be removed in case of panics.
panic = "unwind"
incremental = false
# This profile is currently used in building releases for GitHub.
# It may be removed at any time and should not otherwise be relied on.
[profile.release-github]
inherits = "release"
overflow-checks = false
panic = "unwind"
lto = "fat"
codegen-units = 1
strip = "symbols"
[workspace]
members = [
"gix-actor",
"gix-url",
"gix-hash",
"gix-validate",
"gix-ref",
"gix-command",
"gix-config",
"gix-config-value",
"gix-discover",
"gix-features",
"gix-trace",
"gix-commitgraph",
"gix-chunk",
"gix-quote",
"gix-object",
"gix-glob",
"gix-diff",
"gix-merge",
"gix-date",
"gix-traverse",
"gix-dir",
"gix-index",
"gix-bitmap",
"gix-worktree",
"gix-worktree-state",
"gix-status",
"gix-revision",
"gix-packetline",
"gix-packetline-blocking",
"gix-mailmap",
"gix-macros",
"gix-note",
"gix-negotiate",
"gix-fetchhead",
"gix-prompt",
"gix-filter",
"gix-sec",
"gix-lfs",
"gix-rebase",
"gix-sequencer",
"gix-submodule",
"gix-transport",
"gix-credentials",
"gix-protocol",
"gix-pack",
"gix-odb",
"gix-tempfile",
"gix-lock",
"gix-attributes",
"gix-ignore",
"gix-pathspec",
"gix-refspec",
"gix-path",
"gix-utils",
"gix-fs",
"gix-blame",
"gix",
"gitoxide-core",
"gix-hashtable",
"gix-tui",
"gix-tix",
"gix-archive",
"gix-worktree-stream",
"gix-revwalk",
"gix-fsck",
"tests/tools",
"tests/it",
"gix-diff/tests",
"gix-pack/tests",
"gix-odb/tests",
"gix-worktree-state/tests",
"gix-status/tests",
"gix-worktree/tests",
"gix-index/tests",
"gix-ref/tests",
"gix-config/tests",
"gix-traverse/tests",
]
[workspace.dependencies]
[package.metadata.docs.rs]
features = ["document-features", "max"]
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/gitoxide-max-pure-v{ version }-{ target }{ archive-suffix }"
bin-dir = "gitoxide-max-pure-v{ version }-{ target }/{ bin }{ binary-ext }"
[workspace.lints.rust]
# TODO: enable this
# unused_qualifications = "warn"
[workspace.lints.clippy]
pedantic = { level = "warn", priority = -1 }
#
# Reviewed and allowed lints
enum_glob_use = "allow" # x97
missing_errors_doc = "allow" # x1792
missing_panics_doc = "allow" # x447
module_name_repetitions = "allow" # x125
must_use_candidate = "allow" # x1696
#
# Lints that we may want to forbid in the future
default_trait_access = "allow" # x709
doc_markdown = "allow" # x552
cast_possible_truncation = "allow" # x216
needless_pass_by_value = "allow" # x205
return_self_not_must_use = "allow" # x204
unreadable_literal = "allow" # x169
items_after_statements = "allow" # x164
single_match_else = "allow" # x162
too_many_lines = "allow" # x161
unnecessary_wraps = "allow" # x110
match_same_arms = "allow" # x99
cast_lossless = "allow" # x91
ignored_unit_patterns = "allow" # x80
used_underscore_binding = "allow" # x75
needless_raw_string_hashes = "allow" # x75
implicit_clone = "allow" # x70
manual_let_else = "allow" # x64
cast_precision_loss = "allow" # x56
trivially_copy_pass_by_ref = "allow" # x43
redundant_else = "allow" # x42
if_not_else = "allow" # x37
match_wildcard_for_single_variants = "allow" # x35
cast_sign_loss = "allow" # x35
similar_names = "allow" # x32
struct_excessive_bools = "allow" # x29
cast_possible_wrap = "allow" # x26
explicit_iter_loop = "allow" # x24
explicit_into_iter_loop = "allow" # x22
explicit_deref_methods = "allow" # x22
inconsistent_struct_constructor = "allow" # x18
range_plus_one = "allow" # x17
inefficient_to_string = "allow" # x14
from_iter_instead_of_collect = "allow" # x13
unused_self = "allow" # x10
many_single_char_names = "allow" # x10
manual_string_new = "allow" # x10
iter_not_returning_iterator = "allow" # x10
option_option = "allow" # x9
inline_always = "allow" # x8
manual_assert = "allow" # x7
iter_without_into_iter = "allow" # x6
copy_iterator = "allow" # x6
should_panic_without_expect = "allow" # x5
transmute_ptr_to_ptr = "allow" # x4
match_wild_err_arm = "allow" # x4
manual_is_variant_and = "allow" # x4
bool_to_int_with_if = "allow" # x4
struct_field_names = "allow" # x3
wildcard_imports = "allow" # x2
needless_for_each = "allow" # x2
naive_bytecount = "allow" # x2
mut_mut = "allow" # x2
match_bool = "allow" # x2
fn_params_excessive_bools = "allow" # x2
filter_map_next = "allow" # x2
checked_conversions = "allow" # x2
borrow_as_ptr = "allow" # x2
unnecessary_join = "allow" # x1
stable_sort_primitive = "allow" # x1
no_effect_underscore_binding = "allow" # x1
empty_docs = "allow"
too_long_first_doc_paragraph = "allow"