Skip to content

Commit 9797f41

Browse files
committed
Start scaffolding gix blame
1 parent b2bd2cb commit 9797f41

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
@@ -1398,6 +1398,15 @@ pub fn main() -> Result<()> {
13981398
},
13991399
),
14001400
},
1401+
Subcommands::Blame { file } => prepare_and_run(
1402+
"blame",
1403+
trace,
1404+
verbose,
1405+
progress,
1406+
progress_keep_open,
1407+
None,
1408+
move |_progress, _out, _err| core::repository::blame::blame_file(repository(Mode::Lenient)?, &file),
1409+
),
14011410
Subcommands::Completions { shell, out_dir } => {
14021411
let mut app = Args::command();
14031412

src/plumbing/options/mod.rs

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

0 commit comments

Comments
 (0)