Skip to content

Commit e287c08

Browse files
committed
Make features easier to use
1 parent 4a04c13 commit e287c08

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

Diff for: Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ test = false
2222
doctest = false
2323

2424
[features]
25-
default = ["fast", "pretty-cli"]
25+
default = ["pretty"]
26+
pretty = ["fast", "pretty-cli"]
27+
lean = ["fast", "lean-cli"]
28+
small = ["lean-cli"]
29+
2630
fast = ["git-features/parallel", "git-features/fast-sha1"]
2731
pretty-cli = ["structopt",
2832
"git-features/progress-prodash",

Diff for: Makefile

+11-11
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ release-default: always ## the default build, big bug pretty (builds in ~2min 35
1717
cargo build --release
1818

1919
release-lean: always ## lean and fast (builds in ~1min 10s)
20-
cargo build --release --no-default-features --features lean-cli,fast
20+
cargo build --release --no-default-features --features lean
2121

2222
release-small: always ## minimal dependencies, at cost of performance (builds in ~46s)
23-
cargo build --release --no-default-features --features lean-cli
23+
cargo build --release --no-default-features --features small
2424

2525
##@ Development
2626

2727
target/release/gio: always
28-
cargo build --release --no-default-features --features lean-cli
28+
cargo build --release --no-default-features --features small
2929

3030
lint: ## Run lints with clippy
3131
cargo clippy
@@ -39,14 +39,14 @@ benchmark: target/release/gio ## see how fast things are, powered by hyperfine
3939

4040
##@ Testing
4141

42-
tests: check unit-tests journey-tests journey-tests-lean-cli ## run all tests, including journey tests
42+
tests: check unit-tests journey-tests journey-tests-small ## run all tests, including journey tests
4343

4444
check: ## Build all code in suitable configurations
4545
cargo check --all
4646
cargo check --all --all-features
47-
cargo check --no-default-features --features lean-cli
48-
cargo check --no-default-features --features pretty-cli
49-
cargo check --no-default-features --features lean-cli,fast
47+
cargo check --no-default-features --features small
48+
cargo check --no-default-features --features pretty
49+
cargo check --no-default-features --features lean
5050
cd gitoxide-core && cargo check --all-features
5151
cd git-object && cargo check --all-features
5252
cd git-odb && cargo check --all-features
@@ -62,11 +62,11 @@ continuous-unit-tests: ## run all unit tests whenever something changes
6262

6363
journey-tests: always ## run stateless journey tests (pretty-cli)
6464
cargo build
65-
./tests/stateless-journey.sh target/debug/gio target/debug/giop pretty_and_fast
65+
./tests/stateless-journey.sh target/debug/gio target/debug/giop pretty
6666

67-
journey-tests-lean-cli: always ## run stateless journey tests (lean-cli)
68-
cargo build --no-default-features --features lean-cli
69-
./tests/stateless-journey.sh target/debug/gio target/debug/giop lean_and_small
67+
journey-tests-small: always ## run stateless journey tests (lean-cli)
68+
cargo build --no-default-features --features small
69+
./tests/stateless-journey.sh target/debug/gio target/debug/giop small
7070

7171
continuous-journey-tests: ## run stateless journey tests whenever something changes
7272
watchexec $(MAKE) journey-tests

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ The top-level command-line interface.
172172
* **lean-cli** _(mutually exclusive to pretty-cli)_
173173
* Use `argh` to produce a usable binary with decent documentation that is smallest in size, usually 300kb less than `pretty-cli`.
174174
* If `pretty-cli` is enabled as well, `small-cli` will take precedence, and you pay for building unnecessary dependencies.
175+
176+
There are convenience features, which combine common choices of the above into one name
177+
178+
* **lean** = *lean-cli* + *fast*
179+
* **pretty** = *pretty-cli* + *fast*
180+
* **small** = *lean-cli*
175181

176182
### git-features
177183

Diff for: tests/stateless-journey.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ title "CLI ${kind}"
6969
expect_run $SUCCESSFULLY "$exe_plumbing" verify-pack --statistics "$PACK_INDEX_FILE"
7070
}
7171
)
72-
if test "$kind" = pretty_and_fast; then
72+
if test "$kind" = pretty; then
7373
(with "statistics (JSON)"
7474
it "verifies the pack index successfully and with desired output" && {
7575
WITH_SNAPSHOT="$snapshot/plumbing-verify-pack-index-with-statistics-json-success" \

0 commit comments

Comments
 (0)