MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / import_shape_summary

Function import_shape_summary

atomic-cli/src/commands/git/parallel.rs:2674–2711  ·  view source on GitHub ↗
(parsed: &ParsedCommit, line_index: &ImportLineIndex)

Source from the content-addressed store, hash-verified

2672}
2673
2674fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String {
2675 let mut entries: Vec<(usize, String)> = parsed
2676 .files
2677 .iter()
2678 .map(|file| {
2679 let (current_lines, indexed_lines, imported_commits) =
2680 import_shape_for_file(file, line_index);
2681 let bytes = file
2682 .new_content
2683 .as_ref()
2684 .or(file.old_content.as_ref())
2685 .map(|content| content.len())
2686 .unwrap_or(0);
2687 let weight = current_lines
2688 .saturating_mul(imported_commits.max(1))
2689 .saturating_add(indexed_lines);
2690 (
2691 weight,
2692 format!(
2693 "{} op={:?} lines={} indexed_lines={} file_commits={} bytes={}",
2694 file.path,
2695 file.operation,
2696 current_lines,
2697 indexed_lines,
2698 imported_commits,
2699 bytes
2700 ),
2701 )
2702 })
2703 .collect();
2704 entries.sort_by_key(|entry| std::cmp::Reverse(entry.0));
2705 entries
2706 .into_iter()
2707 .take(3)
2708 .map(|(_, entry)| entry)
2709 .collect::<Vec<_>>()
2710 .join("; ")
2711}
2712
2713fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String {
2714 if skips.is_empty() {

Callers

nothing calls this directly

Calls 6

import_shape_for_fileFunction · 0.85
as_refMethod · 0.80
collectMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected