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

Function import_shape_summary

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

Source from the content-addressed store, hash-verified

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