Git pack文件输入格式 [英] Git pack file entry format
问题描述
我对Git pack文件格式的理解如下所示:
其中表格为32位宽,前三位为32位单词是包文件头。最后一行32位是条目的前4个字节。据我了解,条目的大小由MSB设置的连续字节指定,然后是压缩数据。
在MSB未设置的第一个字节中,是压缩数据的MSB部分,还是差距?如果它是压缩数据的一部分,那么如何保证当数据被压缩时该位不会被设置?
我阅读 pack file documentation 指出大小的最后一个字节(在你的例子中偏移15)将会把MSB设置为0.
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?
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.
这篇关于Git pack文件输入格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!