Skip to content

Commit acfb3c7

Browse files
committed
Put blame command behind feature flag
1 parent f0dcc2a commit acfb3c7

File tree

7 files changed

+13
-1
lines changed

7 files changed

+13
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ http-client-curl-rustls = ["gix/blocking-http-transport-curl-rustls"]
161161
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) using **reqwest**.
162162
http-client-reqwest = ["gix/blocking-http-transport-reqwest-rust-tls"]
163163

164+
## Add blame command similar to `git blame`.
165+
blame = ["gix/blame", "gitoxide-core/blame"]
166+
164167
#! #### Async
165168
#!
166169
## Use async client networking.

gitoxide-core/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ async-client = ["gix/async-network-client-async-std", "gix-transport-configurati
4646
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
4747
serde = ["gix/serde", "dep:serde_json", "dep:serde", "bytesize/serde"]
4848

49+
## Add blame command similar to `git blame`.
50+
blame = []
4951

5052
[dependencies]
5153
# deselect everything else (like "performance") as this should be controllable by the parent application.

gitoxide-core/src/repository/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub enum PathsOrPatterns {
1919

2020
#[cfg(feature = "archive")]
2121
pub mod archive;
22+
#[cfg(feature = "blame")]
2223
pub mod blame;
2324
pub mod commit;
2425
pub mod config;

gix/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ blob-diff = ["gix-diff/blob", "attributes"]
141141
## Add functions to specifically merge files, using the standard three-way merge that git offers.
142142
blob-merge = ["dep:gix-merge", "gix-merge/blob", "attributes"]
143143

144+
## Add blame command similar to `git blame`.
145+
blame = ["dep:gix-blame"]
146+
144147
## Make it possible to turn a tree into a stream of bytes, which can be decoded to entries and turned into various other formats.
145148
worktree-stream = ["gix-worktree-stream", "attributes"]
146149

@@ -368,7 +371,7 @@ gix-command = { version = "^0.3.9", path = "../gix-command", optional = true }
368371

369372
gix-worktree-stream = { version = "^0.15.0", path = "../gix-worktree-stream", optional = true }
370373
gix-archive = { version = "^0.15.0", path = "../gix-archive", default-features = false, optional = true }
371-
gix-blame = { version= "^0.0.0", path ="../gix-blame" }
374+
gix-blame = { version= "^0.0.0", path ="../gix-blame", optional = true }
372375

373376
# For communication with remotes
374377
gix-protocol = { version = "^0.45.3", path = "../gix-protocol", optional = true }

gix/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
pub use gix_actor as actor;
9696
#[cfg(feature = "attributes")]
9797
pub use gix_attributes as attrs;
98+
#[cfg(feature = "blame")]
9899
pub use gix_blame as blame;
99100
#[cfg(feature = "command")]
100101
pub use gix_command as command;

src/plumbing/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,7 @@ pub fn main() -> Result<()> {
14351435
},
14361436
),
14371437
},
1438+
#[cfg(feature = "blame")]
14381439
Subcommands::Blame { file } => prepare_and_run(
14391440
"blame",
14401441
trace,

src/plumbing/options/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ pub enum Subcommands {
145145
#[clap(subcommand)]
146146
Free(free::Subcommands),
147147
/// Blame lines in a file
148+
#[cfg(feature = "blame")]
148149
Blame {
149150
file: std::ffi::OsString,
150151
},

0 commit comments

Comments
 (0)