Skip to content

Commit 7b5d029

Browse files
committed
Draft PoC of blame using gitoxide
1 parent 2374e00 commit 7b5d029

File tree

4 files changed

+163
-106
lines changed

4 files changed

+163
-106
lines changed

Cargo.lock

Lines changed: 66 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asyncgit/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ fuzzy-matcher = "0.3"
2525
git2 = "0.20"
2626
git2-hooks = { path = "../git2-hooks", version = ">=0.5" }
2727
gix = { version = "0.74.1", default-features = false, features = [
28+
"blame",
29+
"blob-diff",
2830
"max-performance",
2931
"revision",
3032
"mailmap",

asyncgit/src/error.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ use thiserror::Error;
77
///
88
#[derive(Error, Debug)]
99
pub enum GixError {
10+
///
11+
#[error("gix::config::diff::algorithm error: {0}")]
12+
ConfigDiffAlgorithm(#[from] gix::config::diff::algorithm::Error),
13+
1014
///
1115
#[error("gix::discover error: {0}")]
1216
Discover(#[from] Box<gix::discover::Error>),
@@ -47,6 +51,12 @@ pub enum GixError {
4751
#[error("gix::reference::iter::init::Error error: {0}")]
4852
ReferenceIterInit(#[from] gix::reference::iter::init::Error),
4953

54+
///
55+
#[error("gix::repository::blame_file::Error error: {0}")]
56+
RepositoryBlameFile(
57+
#[from] Box<gix::repository::blame_file::Error>,
58+
),
59+
5060
///
5161
#[error("gix::revision::walk error: {0}")]
5262
RevisionWalk(#[from] gix::revision::walk::Error),
@@ -201,6 +211,12 @@ impl<T> From<crossbeam_channel::SendError<T>> for Error {
201211
}
202212
}
203213

214+
impl From<gix::config::diff::algorithm::Error> for Error {
215+
fn from(error: gix::config::diff::algorithm::Error) -> Self {
216+
Self::Gix(GixError::from(error))
217+
}
218+
}
219+
204220
impl From<gix::discover::Error> for GixError {
205221
fn from(error: gix::discover::Error) -> Self {
206222
Self::Discover(Box::new(error))
@@ -348,3 +364,15 @@ impl From<gix::worktree::open_index::Error> for Error {
348364
Self::Gix(GixError::from(error))
349365
}
350366
}
367+
368+
impl From<gix::repository::blame_file::Error> for GixError {
369+
fn from(error: gix::repository::blame_file::Error) -> Self {
370+
Self::RepositoryBlameFile(Box::new(error))
371+
}
372+
}
373+
374+
impl From<gix::repository::blame_file::Error> for Error {
375+
fn from(error: gix::repository::blame_file::Error) -> Self {
376+
Self::Gix(GixError::from(error))
377+
}
378+
}

0 commit comments

Comments
 (0)