当我做“git push”时,统计意味着什么? (总计,三角洲等) [英] When I do "git push", what do the statistics mean? (Total, delta, etc.)

查看:110
本文介绍了当我做“git push”时,统计意味着什么? (总计,三角洲等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是一个例子:

  $ git push -u myserver master 
计数对象:22,完成。
使用多达8个线程的增量压缩。
压缩对象:100%(14/14),完成。
写作对象:100%(14/14),1.89 KiB | 0字节/秒,完成。
总计14(增量10),重用0(增量0)
到myserver.com:git/myrepo.git
ed46414..0cae272 master - > master
设置分支主设备以从myserver跟踪远程分支主设备。

基本上,上面唯一对我有意义的数字是8个使用多达8个线程,因为我有一个带有超线程的四核处理器,因此我可以运行8个线程。



有22个?为什么说22和14,其他8发生了什么?为什么它说0字节/秒,因为它做了一些东西,花了有限的时间?什么是总计和增量和重用?

关于该示例的详细信息:上面的示例是从终端复制粘贴的在Mac OS X上。我手动做了一个find-replace来代替myrepo和myserver.com,其他的都是逐字的。该仓库有910次提交,自上次推送以来,我做了大约3次提交。这3个新提交影响了至少3个文件。回购包含超过一千个文件。

解决方案

简答



这只是git命令的输出 git count-objects -v 用于推送(当 gc pull clone )。更多信息在手册页中: git-count-objects(1)

  $ git count-objects -v 
...
size:14#Compressing objects:100%(14 / 14)部分(KiB中的大小)
in-pack:22#计数对象:22部分(对象数量)
...



长答案



 计数对象:22 ,完成。 

这是为特定提交计算的git 22个内部对象。在git中几乎所有的东西都是一个对象,并且基本上是将blob保存在其各自哈希下的 .git / objects 文件夹中。更多信息在手册页: 9.2 Git内部 - Git对象

 压缩对象:100%(14/14),完成。 

这是在发送之前压缩对象的git。 14/14 是压缩的KiB中的进展(14 KiB压缩)。

 写作对象:100%(14/14),1.89 KiB | 0字节/秒,完成。 

这是git发送(如果是远程)并写入对象。 <1.89 KiB | 0字节/秒是KiB中的进度和速度(完成时为0字节/秒)。

 总计14(增量10),重用0(增量0)

这是 packfile 算法在git中(参见 9.4 Git Internals - Packfiles )并且相当模糊。它基本上将未使用的对象(通常是较旧的历史记录)包装在 .git / objects / pack 中。打包后,git会检查它是否可以重新使用包(因此重用0 部分)。 delta 0 部分是来自包装或重新使用的KiB收益。


Here is an example:

$ git push -u myserver master
Counting objects: 22, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.89 KiB | 0 bytes/s, done.
Total 14 (delta 10), reused 0 (delta 0)
To myserver.com:git/myrepo.git
   ed46414..0cae272  master -> master
Branch master set up to track remote branch master from myserver.

Basically the only number above that makes any sense to me is the 8 in "using up to 8 threads", because I have a quad-core processor with hyperthreading, therefore I can run 8 threads.

What are there 22 of? Why does it say 22 and then 14, what happened to the other 8? Why does it say 0 bytes/s, given that it did stuff and took finite time? What is "total" and "delta" and "reused"?

Details about the example: The example above is copy-pasted from Terminal on Mac OS X. I manually did a find-replace to substitute in "myrepo" and "myserver.com", everything else is verbatim. The repository has 910 commits, and I made about 3 commits since the prior push. The 3 new commits affected at least 3 files. The repo contains over a thousand files.

解决方案

Short answer

This is merely the output of the git command git count-objects -v for the push (the same command is called for output when gc, pull and clone). More info in the man pages : git-count-objects(1).

$ git count-objects -v
...
size: 14 # The "Compressing objects: 100% (14/14)" part (the size in KiB)
in-pack: 22 # The "Counting objects: 22" part (the number of objects)
...

Long answer

Counting objects: 22, done.

This is git 22 internal objects being counted for that specific commit. Pretty much everything in git is an object, and are basically blobs saved in your .git/objects folder under their respective hash. More info in the man pages : 9.2 Git Internals - Git Objects.

Compressing objects: 100% (14/14), done.

This is git compressing the objects before send. The 14/14 is the progression in KiB of the compression (14 KiB to compress).

Writing objects: 100% (14/14), 1.89 KiB | 0 bytes/s, done.

This is git sending (if remote) and writing the objects. The 1.89 KiB | 0 bytes/s is the progression in KiB and the speed (0 bytes/s when finished).

Total 14 (delta 10), reused 0 (delta 0)

This is the output of the packfile algorithm in git (see 9.4 Git Internals - Packfiles) and is fairly obscure. It basically packs the unused objects, typically older history, in .git/objects/pack. After packing, git checks if it can reuse packs (hence the reused 0 part). The delta 0 part is the gain in KiB from the packing or from the reuse.

这篇关于当我做“git push”时,统计意味着什么? (总计,三角洲等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆