0

I'm trying to understand git objects, to do so, I deflated those with pigz.

I'm getting those outputs:

commit:

commit 241\00tree f9970eae800972a05f2431545a9a5fc9c96262dd
parent c65d793de8af7e37dc1374110f08eee599cf151e
author 'author' <author email> 1643322862 +0100
committer 'author' <author email> 1643322862 +0100

bugfix 2

blob:

blob 6\001
1
1

tree:

tree 32\00100644 file\00\D0\91\FD~[\B6\FA(\C5\A0\BB2\B8\B5S\9DM

My question is : What are the '\00' meaning?

Karichi
  • 55
  • 7
  • https://git-scm.com/book/en/v2/Git-Internals-Git-Objects check `object storage` – eftshift0 Jan 29 '22 at 11:42
  • The `\00`s look like a delimiter. I'm not sure what the first field "tree32" is, but the second field looks like permissions and type of the object being referenced by that tree. The last field would be the SHA, but it seems a little short for a complete (binary) SHA. – SebDieBln Jan 29 '22 at 12:21
  • Did you take a look at the object using `git cat-file` or something similar to see, what `git` itself makes out of it? – SebDieBln Jan 29 '22 at 12:22
  • After some research on the git official documentation, I think \oo are in reallity \u0000 wich is the unicode for null. Objects are maybe baddly decompress by pigz. – Karichi Jan 29 '22 at 13:36

1 Answers1

0

Not everything is text. The nul byte after the data count is Git's standard header terminator, and id's in trees are stored raw, not prettified in text.

jthill
  • 55,082
  • 5
  • 77
  • 137