2 ms·
> But we also get some wilder instances. For example, it looks like our model allows trees to have commits as children: [...] Nope, doesn't work. That's not ac
by masklinn 4y ago
> But we also get some wilder instances. For example, it looks like our model allows trees to have commits as children: [...] Nope, doesn't work.
That's not actually true: a submodule is a commit child of a tree.
I'd assume the issue here is trying to add a child commit with mode 100644 instead of the submodule mode (160000), although tree modes are very much a wonky mess with inconsistent error reporting because there used to be more valid modes than there is now (100664), some of the error reporting is only under fsck, and influenced by traversal order, and bugs in the codebase made bad filemode detection plain not work until 2.38 (because file modes were checked post-normalisation).
> Tags are like commits, but instead of pointing to a tree and parent they point to a commit
Tags are not really like commits, and they can point to a blob, a tree, or an other tag just fine, which is why tags have a "type" header (the type / kind of the pointee).
- nextaccountic 4y agoYes, operationally tags are refs, just like branches (Even though the mental model people use for branches is different than tags https://blog.plover.com/prog/git/branches.html https://blog.plover.com/prog/git/branches.html because when you make a commit when HEAD points to a branch, it updates the branch to point to the new commit, which doesn't happen with tags)