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

Function import_shape_summary

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

Source from the content-addressed store, hash-verified

709}
710
711fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String {
712 let mut entries: Vec<(usize, String)> = parsed
713 .files
714 .iter()
715 .map(|file| {
716 let (current_lines, indexed_lines, imported_commits) =
717 import_shape_for_file(file, line_index);
718 let bytes = file
719 .new_content
720 .as_ref()
721 .or(file.old_content.as_ref())
722 .map(|content| content.len())
723 .unwrap_or(0);
724 let weight = current_lines
725 .saturating_mul(imported_commits.max(1))
726 .saturating_add(indexed_lines);
727 (
728 weight,
729 format!(
730 "{} op={:?} lines={} indexed_lines={} file_commits={} bytes={}",
731 file.path,
732 file.operation,
733 current_lines,
734 indexed_lines,
735 imported_commits,
736 bytes
737 ),
738 )
739 })
740 .collect();
741 entries.sort_by_key(|entry| std::cmp::Reverse(entry.0));
742 entries
743 .into_iter()
744 .take(3)
745 .map(|(_, entry)| entry)
746 .collect::<Vec<_>>()
747 .join("; ")
748}
749
750fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String {
751 if skips.is_empty() {

Callers 1

write_commitMethod · 0.85

Calls 5

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

Tested by

no test coverage detected