codetether-agent 4.7.0-a-002.4

A2A-native AI coding agent for the CodeTether ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Capture `git log --oneline` for the TUI git view.

use std::path::Path;

/// Last 20 commits as oneline strings.
pub fn capture_log(root: &Path) -> Vec<String> {
    let Ok(output) = std::process::Command::new("git")
        .args(["-C", root.to_string_lossy().as_ref()])
        .args(["log", "--oneline", "-20"])
        .output()
    else {
        return vec!["(git log unavailable)".into()];
    };
    String::from_utf8_lossy(&output.stdout)
        .lines()
        .map(String::from)
        .collect()
}