Add compressed size to git-sizer output#140
Open
ScottArbeit wants to merge 8 commits intogithub:masterfrom
Open
Add compressed size to git-sizer output#140ScottArbeit wants to merge 8 commits intogithub:masterfrom
ScottArbeit wants to merge 8 commits intogithub:masterfrom
Conversation
There was a problem hiding this comment.
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
Author
|
cc: @ttaylorr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the compressed size of the
.gitdirectory to the output of thegit-sizertool, and makes a few cosmetic label changes to make the output more clear.Notes
.gitdirectory.Compressed total sizeis 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: