Update dependencies
This commit is contained in:
parent
17bb47dde2
commit
600c25338b
3 changed files with 715 additions and 637 deletions
1334
Cargo.lock
generated
1334
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
10
Cargo.toml
10
Cargo.toml
|
|
@ -4,9 +4,9 @@ version = "0.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.68"
|
anyhow = "1.0.71"
|
||||||
clap = { version = "4.1.1", features = ["derive", "deprecated"] }
|
clap = { version = "4.3.11", features = ["derive", "deprecated"] }
|
||||||
git-repository = "0.33.0"
|
gix = "0.48.0"
|
||||||
terminal_size = "0.2.3"
|
terminal_size = "0.2.6"
|
||||||
textplots = "0.8.0"
|
textplots = "0.8.0"
|
||||||
time = "0.3.17"
|
time = "0.3.23"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use git_repository::{
|
use gix::{
|
||||||
objs::tree::EntryMode,
|
objs::tree::EntryMode,
|
||||||
traverse::{commit::Sorting, tree::Recorder},
|
traverse::{commit::Sorting, tree::Recorder},
|
||||||
Commit, ObjectId, Repository,
|
Commit, ObjectId, Repository,
|
||||||
|
|
@ -63,19 +63,19 @@ fn main() -> anyhow::Result<()> {
|
||||||
let width = args.width.unwrap_or(width as u32 - 12) * 2;
|
let width = args.width.unwrap_or(width as u32 - 12) * 2;
|
||||||
let height = args.height.unwrap_or(height as u32 - 6) * 4;
|
let height = args.height.unwrap_or(height as u32 - 6) * 4;
|
||||||
let sorting = if args.topo {
|
let sorting = if args.topo {
|
||||||
Sorting::Topological
|
Sorting::BreadthFirst
|
||||||
} else {
|
} else {
|
||||||
Sorting::ByCommitTimeNewestFirst
|
Sorting::ByCommitTimeNewestFirst
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut repo = git_repository::discover(args.repo)?;
|
let mut repo = gix::discover(args.repo)?;
|
||||||
repo.object_cache_size(Some(100 * 1024 * 1024));
|
repo.object_cache_size(Some(100 * 1024 * 1024));
|
||||||
let commit = repo.head_commit()?;
|
let commit = repo.head_commit()?;
|
||||||
|
|
||||||
let mut lines = vec![];
|
let mut lines = vec![];
|
||||||
let mut line_cache = HashMap::new();
|
let mut line_cache = HashMap::new();
|
||||||
for ancestor in commit.ancestors().sorting(sorting).all()? {
|
for ancestor in commit.ancestors().sorting(sorting).all()? {
|
||||||
let ancestor = repo.find_object(ancestor.unwrap())?.try_into_commit()?;
|
let ancestor = repo.find_object(ancestor.unwrap().id)?.try_into_commit()?;
|
||||||
let time = ancestor.time()?.format(TIME_FORMAT);
|
let time = ancestor.time()?.format(TIME_FORMAT);
|
||||||
let line_count = count_lines(&repo, &ancestor, &mut line_cache)?;
|
let line_count = count_lines(&repo, &ancestor, &mut line_cache)?;
|
||||||
println!("{} {time} - {line_count}", ancestor.id);
|
println!("{} {time} - {line_count}", ancestor.id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue