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

Function import_shape_summary

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

Source from the content-addressed store, hash-verified

770}
771
772fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String {
773 let mut entries: Vec<(usize, String)> = parsed
774 .files
775 .iter()
776 .map(|file| {
777 let (current_lines, indexed_lines, imported_commits) =
778 import_shape_for_file(file, line_index);
779 let bytes = file
780 .new_content
781 .as_ref()
782 .or(file.old_content.as_ref())
783 .map(|content| content.len())
784 .unwrap_or(0);
785 let weight = current_lines
786 .saturating_mul(imported_commits.max(1))
787 .saturating_add(indexed_lines);
788 (
789 weight,
790 format!(
791 "{} op={:?} lines={} indexed_lines={} file_commits={} bytes={}",
792 file.path,
793 file.operation,
794 current_lines,
795 indexed_lines,
796 imported_commits,
797 bytes
798 ),
799 )
800 })
801 .collect();
802 entries.sort_by_key(|entry| std::cmp::Reverse(entry.0));
803 entries
804 .into_iter()
805 .take(3)
806 .map(|(_, entry)| entry)
807 .collect::<Vec<_>>()
808 .join("; ")
809}
810
811fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String {
812 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