git 仓库分析器

沥川 bio photo By 沥川

背景

触发 1w[BC] 版本仓库中应该放什么文件?, dama 使用 git-size 查看文件情况

DAMA [10:37 AM]
是也乎 ╮(╯▽╰)╭

git-size 是个工具名儿…

目标

找到 git-size 查看 py 仓库文件情况

记录

找到 Measuring the many sizes of a Git repository, 中间提到

s your Git repository bursting at the seams? git-sizer is a new open source tool that can tell you when your repo is getting too big. git-sizer computes various Git repository size metrics and alerts you to any that might cause problems or inconvenience

继续搜索 git-sizer 找到标的( ̄▽ ̄)

  1. Make sure that you have the Git command-line client installed, version >= 2.6
$ git --version
git version 2.10.1

查看发现 git-command 早已安装, 且版本 > 2.6

  1. 去到 release 界面, 下载 git-sizer-1.3.0-darwin-386 版本

  2. git-sizer 加入环境变量

参考 oh-my-zsh

$ vi ~/.zshrc
export PATH="/Users/hugo/Projects/git-sizer-1.3.0-darwin-386:$PATH"
## 保存退出
$ source ~/.zshrc
$ cd py # 进入 gitlab 仓库
$ git-sizer --verbose
Processing blobs: 114
Processing trees: 134
Processing commits: 179
Matching commits to trees: 179
Processing annotated tags: 1
Processing references: 74
| Name                         | Value     | Level of concern               |
| ---------------------------- | --------- | ------------------------------ |
| Overall repository size      |           |                                |
| * Commits                    |           |                                |
|   * Count                    |   179     |                                |
|   * Total size               |  37.8 KiB |                                |
| * Trees                      |           |                                |
|   * Count                    |   134     |                                |
|   * Total size               |  13.2 KiB |                                |
|   * Total tree entries       |   366     |                                |
| * Blobs                      |           |                                |
|   * Count                    |   114     |                                |
|   * Total size               |  1.19 MiB |                                |
| * Annotated tags             |           |                                |
|   * Count                    |     1     |                                |
| * References                 |           |                                |
|   * Count                    |    74     |                                |
|                              |           |                                |
| Biggest objects              |           |                                |
| * Commits                    |           |                                |
|   * Maximum size         [1] |   352 B   |                                |
|   * Maximum parents      [2] |     2     |                                |
| * Trees                      |           |                                |
|   * Maximum entries      [3] |     9     |                                |
| * Blobs                      |           |                                |
|   * Maximum size         [4] |   326 KiB |                                |
|                              |           |                                |
| History structure            |           |                                |
| * Maximum history depth      |    21     |                                |
| * Maximum tag depth      [5] |     1     |                                |
|                              |           |                                |
| Biggest checkouts            |           |                                |
| * Number of directories  [6] |     3     |                                |
| * Maximum path depth     [6] |     2     |                                |
| * Maximum path length    [7] |    37 B   |                                |
| * Number of files        [8] |     9     |                                |
| * Total size of files    [8] |   676 KiB |                                |
| * Number of symlinks         |     0     |                                |
| * Number of submodules   [9] |     1     |                                |

[1]  8019885c98da9c5e92a39c899df74a7f40d9b1df
[2]  ac90a9c27aa621b02f1504b42bc4c7af80958c97
[3]  5daaf3f79e2876dac36b351d5f23c0589ebbc85a (refs/remotes/origin/XiaoYanWork^{tree})
[4]  c55987548f2cc16b8a2d69e90f111daefd93e557 (refs/remotes/origin/xiaoshizi:gif/ch00-1-py-zhpy.gif)
[5]  e0474848cd151270566a897a472a7b9bca139fa1 (refs/tags/ch00)
[6]  5ea3ae3a593135769c273e44453e0b3db3e88d60 (refs/remotes/origin/mac1949^{tree})
[7]  697bdee2a139d8f2bbd4290592f7b7ad1c1bc463 (refs/remotes/origin/recaff^{tree})
[8]  eca737bf865128e6310830f3f4e961d3ccf7e2b6 (refs/remotes/origin/xiaoshizi^{tree})
[9]  d2db49665b34c0625179cf7a02eaa65bc93cd89b (refs/remotes/origin/youying0356^{tree})

Changlog

  • 2019-01-02 lichuan 下载并配置环境变量
  • 2019-01-01 lichuan init.