1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! Git log provider port for audit and compliance workflows.
//!
//! Defines the trait boundary for reading commit history.
//! Production adapters (e.g. git2-based) live in infra crates.
/// A single commit record from the repository history.
///
/// Args:
/// * `hash`: The abbreviated commit hash.
/// * `author_name`: The commit author's name.
/// * `author_email`: The commit author's email.
/// * `timestamp`: ISO-8601 formatted commit timestamp.
/// * `message`: First line of the commit message.
/// * `signature_status`: Classification of the commit's signature.
///
/// Usage:
/// ```ignore
/// let record = CommitRecord {
/// hash: "abc1234".to_string(),
/// author_name: "Alice".to_string(),
/// author_email: "alice@example.com".to_string(),
/// timestamp: "2024-01-15T10:00:00Z".to_string(),
/// message: "initial commit".to_string(),
/// signature_status: SignatureStatus::Unsigned,
/// };
/// ```
/// Classification of a commit's cryptographic signature.
///
/// Usage:
/// ```ignore
/// match status {
/// SignatureStatus::AuthsSigned { signer_did } => println!("Signed by {signer_did}"),
/// SignatureStatus::SshSigned => println!("SSH signed"),
/// SignatureStatus::GpgSigned { verified } => println!("GPG signed, verified={verified}"),
/// SignatureStatus::Unsigned => println!("No signature"),
/// SignatureStatus::InvalidSignature { reason } => println!("Bad sig: {reason}"),
/// }
/// ```
/// Errors from git log provider operations.
/// Port for reading commit history from a Git repository.
///
/// Usage:
/// ```ignore
/// let commits: Vec<CommitRecord> = provider
/// .walk_commits(None, Some(100))?
/// .collect::<Result<Vec<_>, _>>()?;
/// ```