Skip to content

Show dynamic commit and size values during growth data collection#119

Merged
steffen merged 5 commits into
mainfrom
fix/dynamic-growth-progress
Mar 13, 2026
Merged

Show dynamic commit and size values during growth data collection#119
steffen merged 5 commits into
mainfrom
fix/dynamic-growth-progress

Conversation

@nicklegan
Copy link
Copy Markdown
Collaborator

@nicklegan nicklegan commented Mar 11, 2026

Problem

The progress spinner in the HISTORIC & ESTIMATED GROWTH table showed 0 for 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:

  • Commits: cumulative count and year-over-year delta (+N)
  • Object size: cumulative uncompressed size and delta
  • On-disk size: cumulative compressed size and delta
  • Level of concern: updated during progress based on the currently collected values

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: add PreviousStatistics, helper functions for delta formatting, update progress rendering to show live absolute values, deltas, and level of concern, and keep % as placeholders during collection
  • main.go: track beforePrevious and pass it to StartProgress; update PreviousStatistics after each year completes
  • pkg/progress/progress_test.go: update StartProgress calls for the new signature

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 nicklegan self-assigned this Mar 11, 2026
@nicklegan nicklegan requested a review from steffen March 11, 2026 15:08
@steffen
Copy link
Copy Markdown
Owner

steffen commented Mar 12, 2026

@nicklegan This works great! 💖

Regarding the % column: The % column shows the percentage of the delta in that year relatively to the current total value of the repository. So as git-metrics goes through the years, that percentage value changes (as it doesn't have the total yet) and the percentages shown during the progress will not match the ones that are shown once the complete table is calculated and done. E.g. if you have a repository with 4 years history and each year as 25,000 commits, it shows 100% when it has calculated the first year, then it shows 50% and then 25%.
So I think for now we remove updating the percentage in the progress line and only update the absolute numbers and deltas (Δ) and level of concern (). What do you think?

steffen added 2 commits March 13, 2026 13:10
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.
@steffen steffen marked this pull request as ready for review March 13, 2026 12:17
Copilot AI review requested due to automatic review settings March 13, 2026 12:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StartProgress call 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.

Comment thread pkg/progress/progress.go
Comment thread pkg/progress/progress.go Outdated
Comment thread pkg/progress/progress.go
Comment thread main.go Outdated
@steffen steffen merged commit eac5a45 into main Mar 13, 2026
7 checks passed
@steffen steffen deleted the fix/dynamic-growth-progress branch March 13, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants