Skip to content

Commit e7084d8

Browse files
committed
Adapt to changes in gix-blame
1 parent e08cf88 commit e7084d8

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

gitoxide-core/src/repository/blame.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::ffi::OsStr;
55
pub fn blame_file(
66
mut repo: gix::Repository,
77
file: &OsStr,
8-
range: Option<std::ops::Range<u32>>,
8+
options: gix::blame::Options,
99
out: impl std::io::Write,
1010
err: Option<&mut dyn std::io::Write>,
1111
) -> anyhow::Result<()> {
@@ -44,7 +44,7 @@ pub fn blame_file(
4444
cache,
4545
&mut resource_cache,
4646
file.as_bstr(),
47-
range,
47+
options,
4848
)?;
4949
let statistics = outcome.statistics;
5050
write_blame_entries(out, outcome)?;

src/plumbing/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,7 @@ pub fn main() -> Result<()> {
15461546
statistics,
15471547
file,
15481548
range,
1549+
since,
15491550
} => prepare_and_run(
15501551
"blame",
15511552
trace,
@@ -1557,7 +1558,7 @@ pub fn main() -> Result<()> {
15571558
core::repository::blame::blame_file(
15581559
repository(Mode::Lenient)?,
15591560
&file,
1560-
range,
1561+
gix::blame::Options { range, since },
15611562
out,
15621563
statistics.then_some(err),
15631564
)

src/plumbing/options/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clap_complete::Shell;
44
use gitoxide_core as core;
55
use gix::bstr::BString;
66

7-
use crate::shared::AsRange;
7+
use crate::shared::{AsRange, AsTime};
88

99
#[derive(Debug, clap::Parser)]
1010
#[clap(name = "gix", about = "The git underworld", version = option_env!("GIX_VERSION"))]
@@ -167,6 +167,9 @@ pub enum Subcommands {
167167
/// Only blame lines in the given 1-based inclusive range '<start>,<end>', e.g. '20,40'.
168168
#[clap(short='L', value_parser=AsRange)]
169169
range: Option<std::ops::Range<u32>>,
170+
/// Don't consider commits before the given date.
171+
#[clap(long, value_parser=AsTime, value_name = "DATE")]
172+
since: Option<gix::date::Time>,
170173
},
171174
/// Generate shell completions to stdout or a directory.
172175
#[clap(visible_alias = "generate-completions", visible_alias = "shell-completions")]

0 commit comments

Comments
 (0)