Re: Exact format of tree objets
- From
Chico Sokol <chico.sokol@gmail.com>
- Date
- Jun 18, 2013, 13:53 UTC
- Message-ID
- <CABx5MBSFxpp4S8utMu5F_-VE-g4n98h67Rf+NfB=7bSk5qrq5w@mail.gmail.com>
- In-Reply-To
- <loom.20130612T160455-551@post.gmane.org>
Thanks!
By the way, where can I find this kind of specification? I couldn't find the spec of tree objects here: https://github.com/git/git/tree/master/Documentation
-- Chico Sokol
On Wed, Jun 12, 2013 at 11:06 AM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 32 quoted lines
> Junio C Hamano <gitster <at> pobox.com> writes: >> Chico Sokol <chico.sokol <at> gmail.com> writes: >> >> > Is there any official documentation of tree objets format? Are tree >> > objects encoded specially in some way? How can I parse the inflated >> > contents of a tree object? >> > >> > We're suspecting that there is some kind of special format or >> > encoding, because the command "git cat-file -p <sha>" show me ... >> > While "git cat-file tree <sha>" generate ... >> >> "cat-file -p" is meant to be human-readable form. The latter gives >> the exact byte contents read_sha1_file() sees, which is a binary >> format. Essentially, it is a sequence of: >> >> - mode of the entry encoded in octal, without any leading '0' pad; >> - pathname component of the entry, terminated with NUL; >> - 20-byte SHA-1 object name. > > I always wondered why this is the sole object format where SHA-1 is in 20- > byte binary format and not 40-chars hexadecimal string format... > > -- > Jakub Narębski > > > > > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html