(from: string, to: string)
| 179 | }; |
| 180 | |
| 181 | function getCommits(from: string, to: string): RawWeeklyCommit[] { |
| 182 | const output = git([ |
| 183 | "log", |
| 184 | "--format=%H%x09%h%x09%an%x09%cs%x09%s", |
| 185 | "--no-merges", |
| 186 | `--since=${from}T00:00:00`, |
| 187 | `--until=${to}T23:59:59`, |
| 188 | ]); |
| 189 | |
| 190 | if (!output) { |
| 191 | return []; |
| 192 | } |
| 193 | |
| 194 | return output.split("\n").map(parseGitLogLine); |
| 195 | } |
| 196 | |
| 197 | function parseGitLogLine(line: string): RawWeeklyCommit { |
| 198 | const [sha = "", shortSha = "", author = "", date = "", ...subjectParts] = line.split("\t"); |
no test coverage detected