Show dynamic commit and size values during growth data collection#119
Conversation
The progress spinner in the HISTORIC & ESTIMATED GROWTH table previously showed 0 for commits and placeholder dots for delta and percentage columns while data was being collected. This made it appear stuck, especially on large repositories. Track the previous year statistics alongside the current cumulative statistics so the progress display can compute and show real-time commit counts, deltas, and percentages as each year completes.
|
@nicklegan This works great! 💖 Regarding the |
Do not recalculate and render percentage values during growth data\ncollection, because interim totals make those percentages unstable and\nmisleading compared to the final report.\n\nProgress output now updates only absolute values, deltas, and concern\nmarkers while keeping percentage cells as placeholders.
There was a problem hiding this comment.
Pull request overview
Improves the CLI’s growth-data progress spinner so it shows meaningful commit and size values while yearly growth statistics are being collected, reducing the “stuck at 0/…” perception on large repositories.
Changes:
- Extend progress state to carry both current and previous cumulative growth statistics.
- Compute and display commit and size deltas in the progress line during collection.
- Update
StartProgresscall sites to pass the additional “previous statistics” argument.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
pkg/progress/progress.go |
Adds PreviousStatistics to progress state and formats deltas for commits/object size/on-disk size in the spinner output. |
main.go |
Tracks an additional “before previous” cumulative statistics value and wires it into progress initialization/updates. |
pkg/progress/progress_test.go |
Updates unit tests to match the new StartProgress function signature. |
You can also share your feedback on Copilot code review. Take the survey.
Problem
The progress spinner in the HISTORIC & ESTIMATED GROWTH table showed
0for commits and placeholder dots (...) for delta and percentage columns while data was being collected. On large repositories like the Linux kernel, this made it appear stuck for extended periods.Solution
Track the previous year's cumulative statistics alongside the current statistics so the progress display can compute and show meaningful real-time values as each year completes:
+N)The
%columns remain...during progress collection because interim totals are not final and would produce unstable values that do not match the completed report.Values still fall back to
...when genuinely zero (for example, before any data is collected).Changes
pkg/progress/progress.go: addPreviousStatistics, helper functions for delta formatting, update progress rendering to show live absolute values, deltas, and level of concern, and keep%as placeholders during collectionmain.go: trackbeforePreviousand pass it toStartProgress; updatePreviousStatisticsafter each year completespkg/progress/progress_test.go: updateStartProgresscalls for the new signature