Made of:
- a tree: PWD state, not a diff, but rather an efficient representation of the full state
- a comment
- commiter info
- hash of parent commit Process:
- if file didn't change: add compressed filename (hash) to the snapshot
- if file changed: compress it, store it in .git/objects, add filename hash to snapshot
Q. What is an object? A. a commit, tree, blob
pretty print a git object
$ git cat-file -p <tree-hash>
obj-type-code+perms obj-type obj-hash <filename>
100644 blob <hash> world.txt
stored as the deflated: blob <blob-length><null-char><blob>
stored as the deflated: tree <tree-length><null-char>FOREACH object<mode> <filename><object id in hex>
stored as the deflated:
commit <commit-length><null-char>tree <tree-hash>\
author <author-name> <author-email> <timestamp>\
commiter <commiter-name> <commiter-email> <timestamp>\
<commit-msg>
SHA1 of <obj-type> <obj-size><null-char><obj>
foo