suture-cli 1.0.0

A patch-based version control system with semantic merge for structured files
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub(crate) async fn cmd_reflog() -> Result<(), Box<dyn std::error::Error>> {
    let repo = suture_core::repository::Repository::open(std::path::Path::new("."))?;
    let entries = repo.reflog_entries()?;
    if entries.is_empty() {
        println!("No reflog entries.");
        return Ok(());
    }
    for (head_hash, entry) in entries.iter().rev() {
        let short_hash = if head_hash.len() >= 8 {
            &head_hash[..8]
        } else {
            head_hash
        };
        println!("{} {}", short_hash, entry);
    }
    Ok(())
}