Parse raw git log output into individual commits
(raw: string)
| 212 | |
| 213 | /** Parse raw git log output into individual commits */ |
| 214 | function parseGitLog(raw: string): { hash: string; subject: string; body: string }[] { |
| 215 | const commits: { hash: string; subject: string; body: string }[] = []; |
| 216 | const entries = raw.split('---END---').filter((e) => e.trim()); |
| 217 | |
| 218 | for (const entry of entries) { |
| 219 | const lines = entry.trim().split('\n'); |
| 220 | if (lines.length < 2) continue; |
| 221 | commits.push({ |
| 222 | hash: lines[0]!.trim(), |
| 223 | subject: lines[1]!.trim(), |
| 224 | body: lines.slice(2).join('\n').trim(), |
| 225 | }); |
| 226 | } |
| 227 | return commits; |
| 228 | } |
| 229 | |
| 230 | /** Parse a commit subject into conventional commit format */ |
| 231 | function parseConventionalCommit(commit: { hash: string; subject: string; body: string }): ConventionalCommit | null { |
no outgoing calls
no test coverage detected
searching dependent graphs…