this fall I worked with the core Git folks on writing an official data model for Git and it just got merged! I learned a few new things from writing it. https://github.com/git/git/blob/master/Documentation/gitdatamodel.adoc

here are some things I learned while writing this:

1. Commits can have "extra fields", for example a GPG signature

2. I always thought entries in a tree had 4 fields, but there are actually only 3 (file name, file type, and object ID)

3. Git sometimes prints out file types as a bit set (100644), but it's really more like an enum, since there are only 5 file types (regular file, executable file, symlink, directory, and gitlink)

(2/?)

@b0rk I don't think git has any native recognition of directories. It just knows about paths. Or at least you cannot commit an empty directory.

@enhancedscurry i just looked into this and as far as I can tell from my experimentation, it's theoretically possible in Git to create a commit with an empty directory in it (like there's nothing in the data model that prevents it).

BUT if you check out that commit, the checkout won't include the empty directory, so the effect is that (as we all know) you can't have empty directories in Git.

@enhancedscurry My best guess is that this is because even though in Git a _commit_ can theoretically contain an empty directory, the _index_ can't have an empty directory.
@enhancedscurry @b0rk A directory points to another tree object, while a file points to a blob. Something like that. (Yes, I had to assemble commits by hand.)