4 ms·
Go read a git tutorial. It's a faster way to learn than asking random questions of strangers on a tech news site.
by nnethercote 13y ago
Go read a git tutorial. It's a faster way to learn than asking random questions of strangers on a tech news site.
- zackmorris 13y agoAfter I posted that comment, I remembered that I had read one a couple of years ago and it explained trees and blobs. Looking at the tree structure now though, I can't see any reason why a leaf has to be a blob instead of a tree. So without some new rationale, I have to come to the conclusion that ignoring empty directories was a political decision. Perhaps I missed something in how the hash is computed, for example if the node's name wasn't part of the hash, then empty directories would have no effect on it, which would mean the same hash could represent different directory structures, which would be incorrect. But that can't be right, because git can store empty files. This all means that git can't represent an arbitrary directory structure. That's a big deal, because it can't be used to say, incrementally back up a hard drive without help. That's all well and good if its main use is version control, but I'll never look at it quite the same way again.