![]() This means that there are different areas of operations where Git would be faster than Mercurial, all other things considered equal (like merges, or showing history of a project), and areas where Mercurial would be faster than Git (like applying patches, or showing history of a single file). In Git blob object store one version of a contents of a file in Mercurial filelog stores whole history of a single file (if we do not take into account here any complications with renames). Looking at repository structure in Git versus in Mercurial, one can see that Git is more like object database (or a content-addressed filesystem), and Mercurial more like traditional fixed-field relational database.ĭifferences: In Git the tree objects form a hierarchical structure in Mercurial manifest file is flat structure. Mercurial uses transaction journal to provide atomicity of operations, and relies on truncating files to clean-up after failed or interrupted operation. Mercurial (as far as I understand it) stores history of a file in a filelog (together, I think, with extra metadata like rename tracking, and some helper information) it uses flat structure called manifest to store directory structure, and structure called changelog which store information about changesets (revisions), including commit message and zero, one or two parents. (This method provides better compression of repositories.) ![]() Git repositories require periodic maintenance using git gc (to reduce disk space and improve performance), although nowadays Git does that automatically. Atomicity of operations is provided by the fact, that reference to a new object is written (atomically, using create + rename trick) after writing an object. Git uses two ways of storing objects: loose format, where each object is stored in a separate file (those files are written once, and never modified), and packed format where many objects are stored delta-compressed in a single file. In Git there are four types of objects in its object database: blob objects which contain contents of a file, hierarchical tree objects which store directory structure, including file names and relevant parts of file permissions (executable permission for files, being a symbolic link), commit object which contain authorship info, pointer to snapshot of state of repository at revision represented by a commit (via a tree object of top directory of project) and references to zero or more parent commits, and tag objects which reference other objects and can be signed using PGP / GPG. For example hg bisect command in Mercurial (formerly bisect extension) was inspired by git bisect command in Git, while idea of git bundle was inspired by hg bundle. Both projects borrow ideas from each other. There are a few things that differ Mercurial from Git, but there are other things that make them similar. Mercurial uses extensions (plugins) and established API Git has scriptability and established formats.Both have support for bundles files for off-line transport. Network: Mercurial supports SSH and HTTP "smart" protocols, and static HTTP protocol modern Git supports SSH, HTTP and GIT "smart" protocols, and HTTP(S) "dumb" protocol.Mercurial uses rename tracking, while Git uses rename detection to deal with file renames. ![]() current branch) and revision ranges on this local numbering Git provides a way to refer to revision relative to branch tip, and revision ranges are topological (based on graph of revisions) Revision naming and ranges: Mercurial provides revision numbers, local to repository, and bases relative revisions (counting from tip, i.e.Branches: In Mercurial basic workflow is based on anonymous heads Git uses lightweight named branches, and has special kind of branches ( remote-tracking branches) that follow branches in remote repository.hg/localtags in Git tags are refs residing in refs/tags/ namespace, and by default are autofollowed on fetching and require explicit pushing. hgtags file with special rules for per-repository tags, and has also support for local tags in. Repository structure: Mercurial doesn't allow octopus merges (with more than two parents), nor tagging non-commit objects.Here it would be nice to have some syntax for table, something like in PHPMarkdown / MultiMarkdown / Maruku extension of Markdown ![]() ![]() Thanks to all people on on #mercurial IRC channel who provided help about Mercurial for this writeup Summary I know Mercurial from documentation and some from discussion on #revctrl IRC channel on FreeNode. Disclaimer: I use Git, follow Git development on git mailing list, and even contribute a bit to Git (gitweb mainly). ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |