| 2711 | } |
| 2712 | |
| 2713 | fn graph_first_skip_summary(skips: &[GraphFirstSkip], parsed: &ParsedCommit) -> String { |
| 2714 | if skips.is_empty() { |
| 2715 | return String::new(); |
| 2716 | } |
| 2717 | |
| 2718 | skips |
| 2719 | .iter() |
| 2720 | .take(5) |
| 2721 | .map(|skip| { |
| 2722 | let lines = parsed |
| 2723 | .files |
| 2724 | .iter() |
| 2725 | .find(|file| file.path == skip.path) |
| 2726 | .and_then(|file| { |
| 2727 | file.new_content |
| 2728 | .as_deref() |
| 2729 | .or(file.old_content.as_deref()) |
| 2730 | .map(count_line_units) |
| 2731 | }) |
| 2732 | .unwrap_or(0); |
| 2733 | format!( |
| 2734 | "{} op={:?} reason={} lines={}", |
| 2735 | skip.path, skip.operation, skip.reason, lines |
| 2736 | ) |
| 2737 | }) |
| 2738 | .collect::<Vec<_>>() |
| 2739 | .join("; ") |
| 2740 | } |
| 2741 | |
| 2742 | pub(crate) fn trace_git_import_enabled() -> bool { |
| 2743 | std::env::var_os("ATOMIC_TRACE_GIT_IMPORT").is_some() |