Skip to content

Commit

Permalink
first review round
Browse files Browse the repository at this point in the history
* document as much as possible
* simplify signatures
* add TODOs for other opportunities
  • Loading branch information
Byron committed Dec 23, 2024
1 parent 80e5804 commit 8b68c2f
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 218 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ The top-level crate that acts as hub to all functionality provided by the `gix-*
* [x] safe with cycles and recursive configurations
* [x] multi-line with comments and quotes
* **promisor**
* It's vague, but these seems to be like index files allowing to fetch objects from a server on demand.
* It's vague, but these seem to be like index files allowing to fetch objects from a server on demand.
* [x] API documentation
* [ ] Some examples

Expand Down Expand Up @@ -363,10 +363,17 @@ Check out the [performance discussion][gix-diff-performance] as well.

### gix-blame

* [ ] commit-annotations for a single file
* [x] commit-annotations for a single file
- [ ] progress
- [ ] interruptability
- [ ] interruptibility
- [ ] streaming
- [ ] support for worktree changes (creates virtual commit on top of `HEAD`)
- [ ] shallow-history support
- [ ] rename tracking (track different paths through history)
- [ ] commits to ignore
* **Performance-Improvements**
- [ ] use commit-graph bloom filter for performance
- [ ] traverse input-commits in correct order without `compute_indegrees_to_depth()`
* [x] API documentation
* [ ] Examples

Expand Down
8 changes: 3 additions & 5 deletions gitoxide-core/src/repository/blame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ pub fn blame_file(mut repo: gix::Repository, file: &OsStr, out: impl std::io::Wr
repo.object_cache_size_if_unset(repo.compute_object_cache_size_for_tree_diffs(&**repo.index_or_empty()?));

let suspect = repo.head()?.peel_to_commit_in_place()?;
let traverse: Vec<_> =
let traverse =
gix::traverse::commit::topo::Builder::from_iters(&repo.objects, [suspect.id], None::<Vec<gix::ObjectId>>)
.build()?
.collect();
.build()?;
let mut resource_cache = repo.diff_resource_cache_for_tree_diff()?;

let work_dir: PathBuf = repo
Expand All @@ -19,11 +18,10 @@ pub fn blame_file(mut repo: gix::Repository, file: &OsStr, out: impl std::io::Wr
.into();
let file_path: &BStr = gix::path::os_str_into_bstr(file)?;

let blame_entries = gix::blame::blame_file(
let blame_entries = gix::blame::file(
&repo.objects,
traverse,
&mut resource_cache,
suspect.id,
work_dir.clone(),
file_path,
)?;
Expand Down
1 change: 1 addition & 0 deletions gix-blame/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rust-version = "1.65"
doctest = false

[dependencies]
gix-path = { version = "^0.10.13", path = "../gix-path" }
gix-diff = { version = "^0.49.0", path = "../gix-diff", default-features = false, features = ["blob"] }
gix-object = { version = "^0.46.0", path = "../gix-object" }
gix-hash = { version = "^0.15.0", path = "../gix-hash" }
Expand Down
Loading

0 comments on commit 8b68c2f

Please sign in to comment.