Skip to content

Commit 6979bce

Browse files
committed
Start scaffolding gix blame
1 parent beb6d9e commit 6979bce

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use std::ffi::OsStr;
2+
3+
pub fn blame_file(_repo: gix::Repository, _file: &OsStr) -> anyhow::Result<()> {
4+
todo!()
5+
}

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+
pub mod blame;
2223
pub mod commit;
2324
pub mod config;
2425
mod credential;

src/plumbing/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,15 @@ pub fn main() -> Result<()> {
14351435
},
14361436
),
14371437
},
1438+
Subcommands::Blame { file } => prepare_and_run(
1439+
"blame",
1440+
trace,
1441+
verbose,
1442+
progress,
1443+
progress_keep_open,
1444+
None,
1445+
move |_progress, _out, _err| core::repository::blame::blame_file(repository(Mode::Lenient)?, &file),
1446+
),
14381447
Subcommands::Completions { shell, out_dir } => {
14391448
let mut app = Args::command();
14401449

src/plumbing/options/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ pub enum Subcommands {
144144
/// Subcommands that need no git repository to run.
145145
#[clap(subcommand)]
146146
Free(free::Subcommands),
147+
/// Blame lines in a file
148+
Blame {
149+
file: std::ffi::OsString,
150+
},
147151
/// Generate shell completions to stdout or a directory.
148152
#[clap(visible_alias = "generate-completions", visible_alias = "shell-completions")]
149153
Completions {

0 commit comments

Comments
 (0)