4 ms·
I don't think that's true. At least, not if you revert something - it reverts only the changes introduced in that commit. (That there is confusion - or even dis
by meuk 8y ago
I don't think that's true. At least, not if you revert something - it reverts only the changes introduced in that commit. (That there is confusion - or even discussion possible - is exactly my point: the abstraction is leaky at worst, and confusing at best).
Edit: You're right, but my point was that the revert command treats a commit like a set of changes, not like the state of of a repo (since you can't revert the state of a repo, but you can revert changes).
- cesarb 8y agoSee for yourself: do a "git cat-file commit HEAD" on any repository. The "tree" line is the current state, the "parent" line(s) are the preceding commit(s). That command shows everything git has recorded for any commit (you can similarly use "git ls-tree <sha1>" to show everything git has recorded for any tree, or "git cat-file blob <sha1>" to show the contents of a file from the tree).
- meuk 8y agoYou're right from a technical perspective. What I meant that as an abstraction, it serves a double purpose (it represents both a node and an edge in the DAG, and it depends on the command that you use which interpretation is right). If you checkout a commit, the commit represents the state of the repository. If you revert a commit, the commit represents a set of changes.