3 ms·
This is cool, but every diagram I've seen for git history uses arrows pointing to the past instead of the future, which is a bit confusing.
by zephjc 14y ago
This is cool, but every diagram I've seen for git history uses arrows pointing to the past instead of the future, which is a bit confusing.
- praptak 14y agoIt represents the actual way commits are represented. Past commits cannot be modified to add children (this would change their hashes) so new commits contain references to parents. Changing this in diagrams would create even greater confusion later on.
- megrimlock 14y agoThe arrows do not represent time. Instead, they reflect the way git represents the commits internally. Each commit is a set of changes to some starting state, identified by the arrow. You could think of it like a citation in a paper that mentions and then extends some earlier findings.
- kisielk 14y agoJust think of it as a commit having a pointer to its parent.
- erso 14y agoThis, in addition to knowing that a commit may have multiple parents (a merge commit, for example).
- erso 14y agokisielk got it right, but to add: A commit knows about its history via its parent(s), thus the arrow pointing to the parent. As far as I know no commit can (or for that matter should) know about its descendants. Does that help?