Git pack file entry format

[亡魂溺海] 提交于 2020-01-01 10:58:18

问题


My understanding of the Git pack file format is something like:

Where the table is 32-bits wide, and the first three 32-bit words are the pack file header. The last row of 32 bits are the first 4 bytes of an entry. As I understand it, the size of the entry is specified by consecutive bytes with the MSB set, followed by compressed data.

In the first byte whose MSB is not set, is the MSB part of the compressed data, or is it a gap? If it's part of the compressed data, how can you guarantee that when the data is compressed that bit won't be set?


回答1:


My reading of the pack file documentation indicates that the last byte of the size (offset 15 in your example) would have the MSB set to 0.




回答2:


There is also some graphical documentation explaining some of the format here. This section is no longer present in Community book, but still available it the location above.



来源:https://stackoverflow.com/questions/76002/git-pack-file-entry-format

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!