-
Notifications
You must be signed in to change notification settings - Fork 158
Add compressed size to git-sizer output #140
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: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds functionality to compute and display the compressed (on-disk) size of the .git directory while also updating some output labels for improved clarity. Key changes include:
- Adding a new GitDirSize field to store the on-disk size of the repository’s .git directory.
- Modifying the output labels in the results table to better differentiate between repository statistics.
- Introducing a new helper function to calculate the .git directory size and updating the GitDir API to return an error when unset.
Reviewed Changes
Copilot reviewed 6 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
sizes/sizes.go | New field GitDirSize added to HistorySize with updated documentation. |
sizes/output.go | Updated labels and added a new section to display the compressed size. |
sizes/dirsize.go | Added new function CalculateGitDirSize to compute the directory size. |
git/git.go | Modified GitDir method to return an error when the git directory is not set. |
git-sizer.go | Updated to use the revised GitDir and integrate the computed GitDirSize. |
CONTRIBUTING.md | Reformatted dependency installation instructions for clarity. |
Files not reviewed (4)
- Makefile.win: Language not supported
- script/bootstrap.ps1: Language not supported
- script/ensure-go-installed.ps1: Language not supported
- script/go.ps1: Language not supported
Comments suppressed due to low confidence (2)
git/git.go:153
- Changing the GitDir function signature to return an error now requires all callers to handle this error. Please verify that all usage sites have been updated to properly manage error propagation.
func (repo *Repository) GitDir() (string, error) {
sizes/dirsize.go:14
- Errors encountered during the directory walk are silently ignored by returning nil. Consider logging these errors or handling them explicitly to aid in diagnosing potential access issues.
err := filepath.Walk(gitDir, func(path string, info os.FileInfo, err error) error {
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
cc: @ttaylorr |
This PR adds the compressed size of the
.git
directory to the output of thegit-sizer
tool, and makes a few cosmetic label changes to make the output more clear.Notes
.git
directory.Compressed total size
is 1e9, which is 1/10th of the scale used to compute it for theUncompressed total size
(10e9). I'm open to feedback on whether or not that's the right estimate to use.Here's the new output run on a large repository, with indicators for where the output has changed: