Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gix upgrade and optimizations #1081

Merged
merged 15 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
- name: Run onefetch
run: cargo run

- name: Run onefetch (with commitgraph)
run: git commit-graph write --no-progress --reachable && cargo run

formatting:
runs-on: ubuntu-latest
steps:
Expand Down
84 changes: 50 additions & 34 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ byte-unit = "4.0.19"
bytecount = "0.6.3"
clap = { version = "4.3.1", features = ["derive"] }
clap_complete = "4.3.1"
gix-features-for-configuration-only = { package = "gix-features", version = "0.29.0", features = [
crossbeam-channel = "0.5.8"
gix-features-for-configuration-only = { package = "gix-features", version = "0.30.0", features = [
"zlib-ng",
] }
gix = { version = "0.45.1", default-features = false, features = [
gix = { version = "0.46.0", default-features = false, features = [
"max-performance-safe",
] }
git2 = { version = "0.17.2", default-features = false }
Expand All @@ -49,6 +50,7 @@ time-humanize = { version = "0.1.3", features = ["time"] }
tokei = "12.1.2"
typetag = "0.2"
yaml-rust = "0.4.5"
parking_lot = "0.12"

[dev-dependencies]
criterion = "0.4.0"
Expand Down
7 changes: 4 additions & 3 deletions src/info/author.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::git::metrics::GitMetrics;
use crate::{
cli::NumberSeparator,
info::{format_number, utils::git::CommitMetrics, utils::info_field::InfoField},
info::{format_number, utils::info_field::InfoField},
};
use serde::Serialize;
use std::fmt::Write;
Expand Down Expand Up @@ -65,8 +66,8 @@ pub struct AuthorsInfo {
}

impl AuthorsInfo {
pub fn new(commit_metrics: &CommitMetrics) -> Self {
let authors = commit_metrics.authors_to_display.clone();
pub fn new(git_metrics: &GitMetrics) -> Self {
let authors = git_metrics.authors_to_display.clone();
Self { authors }
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/info/churn.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::utils::{git::CommitMetrics, info_field::InfoField};
use super::{git::metrics::GitMetrics, utils::info_field::InfoField};
use crate::{cli::NumberSeparator, info::format_number};
use serde::Serialize;
use std::fmt::Write;
Expand Down Expand Up @@ -43,11 +43,11 @@ pub struct ChurnInfo {
pub churn_pool_size: usize,
}
impl ChurnInfo {
pub fn new(commit_metrics: &CommitMetrics) -> Self {
let file_churns = commit_metrics.file_churns_to_display.clone();
pub fn new(git_metrics: &GitMetrics) -> Self {
let file_churns = git_metrics.file_churns_to_display.clone();
Self {
file_churns,
churn_pool_size: commit_metrics.churn_pool_size,
churn_pool_size: git_metrics.churn_pool_size,
}
}
}
Expand Down
16 changes: 10 additions & 6 deletions src/info/commits.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use serde::Serialize;

use super::git::metrics::GitMetrics;
use crate::{
cli::NumberSeparator,
info::{format_number, utils::git::CommitMetrics, utils::info_field::InfoField},
info::{format_number, utils::info_field::InfoField},
};
use serde::Serialize;

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
Expand All @@ -15,10 +15,14 @@ pub struct CommitsInfo {
}

impl CommitsInfo {
pub fn new(commit_metrics: &CommitMetrics, number_separator: NumberSeparator) -> Self {
pub fn new(
git_metrics: &GitMetrics,
is_shallow: bool,
number_separator: NumberSeparator,
) -> Self {
Self {
number_of_commits: commit_metrics.total_number_of_commits,
is_shallow: commit_metrics.is_shallow,
number_of_commits: git_metrics.total_number_of_commits,
is_shallow,
number_separator,
}
}
Expand Down
Loading