git-sizer
git-sizer copied to clipboard
Add compressed size to git-sizer output
This PR adds the compressed size of the .git directory to the output of the git-sizer tool, and makes a few cosmetic label changes to make the output more clear.
Notes
- The compressed size is calculated by computing the on-disk size of the
.gitdirectory. - The scale used to compute the histogram for the new
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. - Label changes are meant to make the output more clear, after fielding questions for years about what "Total size" meant in the Blobs section.
- This is my first contribution to a Go codebase, and while I did more than just vibe-code it, I certainly relied on Copilot to make the changes. If there's a better way to have made these changes, I'm open to feedback.
Here's the new output run on a large repository, with indicators for where the output has changed:
(12:03:26 PM) >C:\Source\GitHub\git-sizer\bin\git-sizer.exe -v
Processing blobs: 4370529
Processing trees: 12753930
Processing commits: 2117746
Matching commits to trees: 2117746
Processing annotated tags: 1294
Processing references: 34998
| Name | Value | Level of concern |
| ---------------------------- | --------- | ------------------------------ |
| Repository statistics | | | <----- changed label
| * Commits | | |
| * Count | 2.12 M | **** |
| * Total size | 1.04 GiB | **** |
| * Trees | | |
| * Count | 12.8 M | ******** |
| * Total size | 60.7 GiB | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| * Total tree entries | 1.32 G | ************************** |
| * Blobs | | |
| * Count | 4.37 M | ** |
| * Uncompressed total size | 463 GiB | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | <----- changed label
| * On-disk size | | | <----- new output
| * Compressed total size | 24.4 GiB | ************************** | <----- new output
| * Annotated tags | | |
| * Count | 1.29 k | |
| * References | | |
| * Count | 35.0 k | * |
| * Branches | 1 | |
| * Tags | 2.17 k | |
| * Remote-tracking refs | 32.8 k | * |
| | | |
| Biggest objects | | |
| * Commits | | |
| * Maximum size [1] | 3.74 MiB | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| * Maximum parents [2] | 7 | |
| * Trees | | |
| * Maximum entries [3] | 10.3 k | ********** |
| * Blobs | | |
| * Maximum size [4] | 99.9 MiB | ********** |
| | | |
| History structure | | |
| * Maximum history depth | 299 k | |
| * Maximum tag depth [5] | 1 | |
| | | |
| Biggest checkouts | | |
| * Number of directories [6] | 37.4 k | ****************** |
| * Maximum path depth [7] | 20 | ** |
| * Maximum path length [8] | 349 B | *** |
| * Number of files [9] | 232 k | **** |
| * Total size of files [6] | 8.30 GiB | ******** |
| * Number of symlinks [10] | 594 | |
| * Number of submodules [11] | 4 | |
_detailed refs redacted_
cc: @ttaylorr