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

Function import_shape_summary

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

Source from the content-addressed store, hash-verified

822}
823
824fn import_shape_summary(parsed: &ParsedCommit, line_index: &ImportLineIndex) -> String {
825 let mut entries: Vec<(usize, String)> = parsed
826 .files
827 .iter()
828 .map(|file| {
829 let (current_lines, indexed_lines, imported_commits) =
830 import_shape_for_file(file, line_index);
831 let bytes = file
832 .new_content
833 .as_ref()
834 .or(file.old_content.as_ref())
835 .map(|content| content.len())
836 .unwrap_or(0);
837 let weight = current_lines
838 .saturating_mul(imported_commits.max(1))
839 .saturating_add(indexed_lines);
840 (
841 weight,
842 format!(
843 "{} op={:?} lines={} indexed_lines={} file_commits={} bytes={}",
844 file.path,
845 file.operation,
846 current_lines,
847 indexed_lines,
848 imported_commits,
849 bytes
850 ),
851 )
852 })
853 .collect();
854 entries.sort_by_key(|entry| std::cmp::Reverse(entry.0));
855 entries
856 .into_iter()
857 .take(3)
858 .map(|(_, entry)| entry)
859 .collect::<Vec<_>>()
860 .join("; ")
861}
862
863fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String {
864 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