-
Notifications
You must be signed in to change notification settings - Fork 1
Add CHECKOUT GROWTH section with year-end repository statistics #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: steffen <[email protected]>
Co-authored-by: steffen <[email protected]>
@copilot Can you come up with a solution where no additional git rev-list commands are needed for the checkout growth section. Maybe consolidate the git command side with the growth table at the beginning? |
… eliminate additional git commands Co-authored-by: steffen <[email protected]>
Done! I've consolidated the checkout growth calculation with the existing growth statistics to eliminate the additional git commands. Key changes:
Performance improvement:
The CHECKOUT GROWTH section still displays correctly at the end with the same data accuracy, but now with improved efficiency by reusing the git data already being processed. Commit: eca7c46 |
…stats to eliminate additional git commands" This reverts commit eca7c46.
…f changes analysis
…go and update test for GetRateOfChanges in git_test.go
This PR adds a new "CHECKOUT GROWTH" section to the git-metrics output that displays repository structure statistics at the end of each year. The section appears at the bottom of the report and provides insights into how the repository's file structure has evolved over time.
New Section Output
Features
The new section tracks five key metrics for each year:
pkg/display/sections/
= depth 3)Implementation
The implementation consolidates data collection with the existing growth statistics calculation to eliminate additional git commands. The checkout growth metrics are calculated during the same
git rev-list --objects --all --before YYYY-01-01
execution used for regular growth statistics, ensuring efficient performance.Key components:
GrowthStatistics
modelGetGrowthStats()
function enhanced to calculate both regular growth stats and checkout growth stats in a single passDisplayCheckoutGrowth()
function for formatted output following existing section patternsPerformance Optimization
The solution eliminates duplicate git operations by consolidating checkout growth calculation with existing growth statistics:
git rev-list
calls per year (growth stats + checkout stats)git rev-list
call per year (calculates both in same loop)The section integrates seamlessly with the existing git-metrics architecture and maintains consistency with other sections' styling and formatting patterns while providing improved performance through consolidated data collection.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.