Skip to content

Commit

Permalink
Adapt to changes in gix-blame
Browse files Browse the repository at this point in the history
  • Loading branch information
cruessler committed Feb 22, 2025
1 parent 5967016 commit 32e36e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gitoxide-core/src/repository/blame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::ffi::OsStr;
pub fn blame_file(
mut repo: gix::Repository,
file: &OsStr,
range: Option<std::ops::Range<u32>>,
options: gix::blame::Options,
out: impl std::io::Write,
err: Option<&mut dyn std::io::Write>,
) -> anyhow::Result<()> {
Expand Down Expand Up @@ -44,7 +44,7 @@ pub fn blame_file(
cache,
&mut resource_cache,
file.as_bstr(),
range,
options,
)?;
let statistics = outcome.statistics;
write_blame_entries(out, outcome)?;
Expand Down
3 changes: 2 additions & 1 deletion src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,7 @@ pub fn main() -> Result<()> {
statistics,
file,
range,
since,
} => prepare_and_run(
"blame",
trace,
Expand All @@ -1557,7 +1558,7 @@ pub fn main() -> Result<()> {
core::repository::blame::blame_file(
repository(Mode::Lenient)?,
&file,
range,
gix::blame::Options { range, since },
out,
statistics.then_some(err),
)
Expand Down
5 changes: 4 additions & 1 deletion src/plumbing/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use clap_complete::Shell;
use gitoxide_core as core;
use gix::bstr::BString;

use crate::shared::AsRange;
use crate::shared::{AsRange, AsTime};

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

0 comments on commit 32e36e4

Please sign in to comment.