Skip to content

Commit

Permalink
Merge branch 'rename-tracking'
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 25, 2023
2 parents 441a64b + f3a2ca8 commit 3827ac6
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 141 deletions.
46 changes: 23 additions & 23 deletions etc/check-package-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,49 @@ function indent () {
}

echo "in root: gitoxide CLI"
(enter cargo-smart-release && indent cargo diet -n --package-size-limit 100KB)
(enter cargo-smart-release && indent cargo diet -n --package-size-limit 110KB)
(enter gix-actor && indent cargo diet -n --package-size-limit 5KB)
(enter gix-pathspec && indent cargo diet -n --package-size-limit 25KB)
(enter gix-refspec && indent cargo diet -n --package-size-limit 25KB)
(enter gix-path && indent cargo diet -n --package-size-limit 20KB)
(enter gix-attributes && indent cargo diet -n --package-size-limit 20KB)
(enter gix-discover && indent cargo diet -n --package-size-limit 25KB)
(enter gix-index && indent cargo diet -n --package-size-limit 55KB)
(enter gix-worktree && indent cargo diet -n --package-size-limit 35KB)
(enter gix-pathspec && indent cargo diet -n --package-size-limit 30KB)
(enter gix-refspec && indent cargo diet -n --package-size-limit 30KB)
(enter gix-path && indent cargo diet -n --package-size-limit 25KB)
(enter gix-attributes && indent cargo diet -n --package-size-limit 25KB)
(enter gix-discover && indent cargo diet -n --package-size-limit 30KB)
(enter gix-index && indent cargo diet -n --package-size-limit 60KB)
(enter gix-worktree && indent cargo diet -n --package-size-limit 40KB)
(enter gix-quote && indent cargo diet -n --package-size-limit 10KB)
(enter gix-revision && indent cargo diet -n --package-size-limit 35KB)
(enter gix-revision && indent cargo diet -n --package-size-limit 40KB)
(enter gix-bitmap && indent cargo diet -n --package-size-limit 10KB)
(enter gix-tempfile && indent cargo diet -n --package-size-limit 30KB)
(enter gix-tempfile && indent cargo diet -n --package-size-limit 35KB)
(enter gix-lock && indent cargo diet -n --package-size-limit 20KB)
(enter gix-config && indent cargo diet -n --package-size-limit 120KB)
(enter gix-config && indent cargo diet -n --package-size-limit 140KB)
(enter gix-config-value && indent cargo diet -n --package-size-limit 20KB)
(enter gix-command && indent cargo diet -n --package-size-limit 10KB)
(enter gix-hash && indent cargo diet -n --package-size-limit 30KB)
(enter gix-chunk && indent cargo diet -n --package-size-limit 10KB)
(enter gix-chunk && indent cargo diet -n --package-size-limit 15KB)
(enter gix-rebase && indent cargo diet -n --package-size-limit 5KB)
(enter gix-sequencer && indent cargo diet -n --package-size-limit 5KB)
(enter gix-features && indent cargo diet -n --package-size-limit 55KB)
(enter gix-features && indent cargo diet -n --package-size-limit 65KB)
(enter gix-ref && indent cargo diet -n --package-size-limit 55KB)
(enter gix-diff && indent cargo diet -n --package-size-limit 10KB)
(enter gix-traverse && indent cargo diet -n --package-size-limit 10KB)
(enter gix-url && indent cargo diet -n --package-size-limit 25KB)
(enter gix-url && indent cargo diet -n --package-size-limit 35KB)
(enter gix-validate && indent cargo diet -n --package-size-limit 5KB)
(enter gix-date && indent cargo diet -n --package-size-limit 15KB)
(enter gix-date && indent cargo diet -n --package-size-limit 25KB)
(enter gix-hashtable && indent cargo diet -n --package-size-limit 5KB)
(enter gix-filter && indent cargo diet -n --package-size-limit 5KB)
(enter gix-lfs && indent cargo diet -n --package-size-limit 5KB)
(enter gix-note && indent cargo diet -n --package-size-limit 5KB)
(enter gix-fetchhead && indent cargo diet -n --package-size-limit 5KB)
(enter gix-sec && indent cargo diet -n --package-size-limit 15KB)
(enter gix-sec && indent cargo diet -n --package-size-limit 25KB)
(enter gix-tix && indent cargo diet -n --package-size-limit 5KB)
(enter gix-credentials && indent cargo diet -n --package-size-limit 30KB)
(enter gix-credentials && indent cargo diet -n --package-size-limit 35KB)
(enter gix-prompt && indent cargo diet -n --package-size-limit 15KB)
(enter gix-object && indent cargo diet -n --package-size-limit 25KB)
(enter gix-commitgraph && indent cargo diet -n --package-size-limit 30KB)
(enter gix-pack && indent cargo diet -n --package-size-limit 125KB)
(enter gix-odb && indent cargo diet -n --package-size-limit 130KB)
(enter gix-commitgraph && indent cargo diet -n --package-size-limit 35KB)
(enter gix-pack && indent cargo diet -n --package-size-limit 135KB)
(enter gix-odb && indent cargo diet -n --package-size-limit 140KB)
(enter gix-protocol && indent cargo diet -n --package-size-limit 80KB)
(enter gix-packetline && indent cargo diet -n --package-size-limit 35KB)
(enter gix-packetline && indent cargo diet -n --package-size-limit 45KB)
(enter gix && indent cargo diet -n --package-size-limit 280KB)
(enter gix-transport && indent cargo diet -n --package-size-limit 85KB)
(enter gitoxide-core && indent cargo diet -n --package-size-limit 100KB)
(enter gix-transport && indent cargo diet -n --package-size-limit 95KB)
(enter gitoxide-core && indent cargo diet -n --package-size-limit 120KB)
15 changes: 8 additions & 7 deletions gitoxide-core/src/query/engine/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::query::engine::update::FileMode;
use crate::query::Command;
use anyhow::Context;
use gix::bstr::ByteSlice;
use gix::prelude::ObjectIdExt;
use gix::Progress;
use rusqlite::{params, OptionalExtension};
use std::collections::HashMap;
Expand Down Expand Up @@ -57,9 +58,11 @@ impl query::Engine {
usize,
) = row?;
let id = gix::ObjectId::from(hash);
let commit_time = id.attach(&self.repo).object()?.into_commit().committer()?.time;
let mode = FileMode::from_usize(mode).context("invalid file mode")?;
info.push(trace_path::Info {
id,
commit_time,
file_id,
mode,
diff: has_diff.then_some(trace_path::Diff {
Expand All @@ -85,20 +88,15 @@ impl query::Engine {
.unwrap_or_default();
let mut found = 0;
progress.show_throughput(start);
let start = std::time::Instant::now();
progress.init(Some(self.commits.len()), gix::progress::count("commits"));
progress.set_name("associate info");
for info in self
.commits
.iter()
.inspect(|_| progress.inc())
.filter_map(|c| info.binary_search_by(|i| i.id.cmp(c)).ok().map(|idx| &info[idx]))
{
found += 1;
info.write_to(&mut out, &self.repo, &seen, max_diff_lines)?;
}
let missing = info.len() - found;
progress.show_throughput(start);
if missing > 0 {
writeln!(
out,
Expand Down Expand Up @@ -140,6 +138,7 @@ mod trace_path {
#[derive(Debug)]
pub struct Info {
pub id: gix::ObjectId,
pub commit_time: gix::date::Time,
pub file_id: usize,
pub mode: FileMode,
pub diff: Option<Diff>,
Expand All @@ -159,8 +158,9 @@ mod trace_path {
Some(source_id) => {
writeln!(
out,
"{}|{} {} {} ➡ {}",
"{}| {} | {} {} {} ➡ {}",
self.diff.unwrap_or_default().format(max_diff_lines),
self.commit_time.format(gix::date::time::format::SHORT),
id.shorten_or_id(),
self.mode.as_str(),
path_by_id[&source_id],
Expand All @@ -170,8 +170,9 @@ mod trace_path {
None => {
writeln!(
out,
"{}|{} {} {}",
"{}| {} | {} {} {}",
self.diff.unwrap_or_default().format(max_diff_lines),
self.commit_time.format(gix::date::time::format::SHORT),
id.shorten_or_id(),
self.mode.as_str(),
path_by_id[&self.file_id]
Expand Down
Loading

0 comments on commit 3827ac6

Please sign in to comment.