acp/git/mod.rs
1//! @acp:module "Git Integration"
2//! @acp:summary "Repository operations, blame tracking, and file history via libgit2"
3//! @acp:domain cli
4//! @acp:layer integration
5//!
6//! # Git Integration
7//!
8//! Provides git repository operations using libgit2 (via git2 crate):
9//! - Repository operations (HEAD, branch, remotes)
10//! - Blame tracking (line-level authorship)
11//! - File history (commits, contributors)
12
13pub mod blame;
14pub mod history;
15pub mod repository;
16
17pub use blame::{BlameInfo, LineBlame};
18pub use history::{FileHistory, HistoryEntry};
19pub use repository::{FileStatus, GitRepository};
20
21use chrono::{DateTime, Utc};
22use serde::{Deserialize, Serialize};
23
24/// Git metadata for a file in the cache
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct GitFileInfo {
27 /// SHA of the last commit that modified this file
28 pub last_commit: String,
29 /// Author name of the last commit
30 pub last_author: String,
31 /// Timestamp of the last modification
32 pub last_modified: DateTime<Utc>,
33 /// Total number of commits that touched this file
34 pub commit_count: usize,
35 /// List of unique contributors to this file
36 pub contributors: Vec<String>,
37}
38
39/// Git metadata for a symbol in the cache
40#[derive(Debug, Clone, Serialize, Deserialize)]
41pub struct GitSymbolInfo {
42 /// SHA of the last commit that modified this symbol's code
43 pub last_commit: String,
44 /// Author name of the last commit
45 pub last_author: String,
46 /// Age of the code in days (since last modification)
47 pub code_age_days: u32,
48}