|
| 1 | +* hg vs. git |
| 2 | + |
| 3 | +this file is to write down the difference between mercurial and git. |
| 4 | + |
| 5 | +** commit structure |
| 6 | + |
| 7 | +for git: |
| 8 | + |
| 9 | ++ 4 kinds of obejct: commit, tree, blob, tag |
| 10 | + + commit contains: |
| 11 | + + link to commits (parents) |
| 12 | + + link to tree (commit fs root) |
| 13 | + + meta info: commit author, email, commit msg, datetime |
| 14 | + + tree contains: list of 3-tuple: name, perm, objid |
| 15 | + + recursively contains tree and blob objs. |
| 16 | + + blob contains data. (used for actually storing data) |
| 17 | + + tag contains |
| 18 | + + link to object (can be commit, tree, blob or other tags) |
| 19 | + + meta info: tag author, email, tag msg, datetime |
| 20 | + |
| 21 | +for mercurial: |
| 22 | + |
| 23 | ++ *each file has its own logs*; different version of the same file, even if they have the same content, would have different "nodeid" |
| 24 | + + this is unlike git where blobs w/ same content will have the same id |
| 25 | ++ mercurial commits (called a "changeset") contains: |
| 26 | + + maximum 2 parent commits (merge commits would have 2 parent commits) |
| 27 | + + manifest: a thing that "describes the contents of the repository at a particular changeset id". basically a list of file names (full relpath) and their nodeid (i.e. a certwtain version in the history of a file) |
| 28 | + + "A manifest describes the state of a project by listing each file and its nodeid to specify which version. Recreating a particular state means simply looking up its manifest and reconstructing the listed file versions from their revlogs." |
| 29 | + + meta info: commit author, email, commit description, datetime |
| 30 | + |
0 commit comments