Skip to content

Commit 0d64f09

Browse files
Add first commit time to table csv output.
1 parent aac777a commit 0d64f09

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

internal/tally/tally.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ func (byPath TalliesByPath) Reduce() map[string]Tally {
194194
for key, pathTallies := range byPath {
195195
var runningTally Tally
196196
runningTally.commitset = map[string]bool{}
197+
runningTally.firstCommitTime = time.Unix(1<<62, 0)
197198

198199
for _, tally := range pathTallies {
199200
runningTally = runningTally.Combine(tally)

table.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ func toRecord(
173173
)
174174
}
175175

176-
return append(record, t.LastCommitTime.Format(time.RFC3339))
176+
return append(
177+
record,
178+
t.LastCommitTime.Format(time.RFC3339),
179+
t.FirstCommitTime.Format(time.RFC3339),
180+
)
177181
}
178182

179183
func writeCsv(
@@ -200,7 +204,7 @@ func writeCsv(
200204
)
201205
}
202206

203-
columnHeaders = append(columnHeaders, "last commit time")
207+
columnHeaders = append(columnHeaders, "last commit time", "first commit time")
204208
w.Write(columnHeaders)
205209

206210
for _, tally := range tallies {

0 commit comments

Comments
 (0)