MCPcopy Index your code
hub / github.com/3eif/gitmotion / generate_gource_visualization

Function generate_gource_visualization

api/src/main.rs:589–679  ·  view source on GitHub ↗
(
    temp_dir: &Path,
    seconds_per_day: f64,
    hide_filenames: bool,
    output_file: &Path,
    settings: &Option<GourceSettings>,
    job_id: Option<&str>,
    repo_url: Option<&str>,
)

Source from the content-addressed store, hash-verified

587}
588
589fn generate_gource_visualization(
590 temp_dir: &Path,
591 seconds_per_day: f64,
592 hide_filenames: bool,
593 output_file: &Path,
594 settings: &Option<GourceSettings>,
595 job_id: Option<&str>,
596 repo_url: Option<&str>,
597) -> Result<(), GourceError> {
598 let title = generate_repo_title(repo_url.unwrap_or(""));
599
600 let mut gource_command = format!(
601 "xvfb-run -a gource {} -1920x1200 \
602 --seconds-per-day {} \
603 --auto-skip-seconds 0.001 \
604 --max-user-speed 500 \
605 --output-framerate 30 \
606 --multi-sampling \
607 --bloom-intensity 0.35 \
608 --user-scale 0.75 \
609 --elasticity 0.01 \
610 --background-colour 000000 \
611 --font-size 20 \
612 --title \"{}\" \
613 --dir-font-size {} \
614 --file-font-size {} \
615 --user-font-size {} \
616 --stop-at-end",
617 temp_dir.to_str().unwrap(),
618 seconds_per_day,
619 title,
620 settings.as_ref().map_or(11, |s| s.dir_font_size),
621 settings.as_ref().map_or(10, |s| s.file_font_size),
622 settings.as_ref().map_or(12, |s| s.user_font_size)
623 );
624
625 let mut hide_elements = vec!["progress"];
626 if hide_filenames {
627 hide_elements.push("filenames");
628 }
629
630 if let Some(settings) = settings {
631 if settings.show_file_extension_key {
632 gource_command.push_str(" --key");
633 }
634 if !settings.show_usernames {
635 hide_elements.push("usernames");
636 }
637 if !settings.show_dirnames {
638 hide_elements.push("dirnames");
639 }
640 }
641
642 if !hide_elements.is_empty() {
643 gource_command.push_str(&format!(" --hide {}", hide_elements.join(",")));
644 }
645
646 gource_command.push_str(&format!(

Callers 1

process_gourceFunction · 0.85

Calls 2

generate_repo_titleFunction · 0.85
log_messageFunction · 0.85

Tested by

no test coverage detected