Changes between Version 22 and Version 23 of GitMigrationProposal

Show
Ignore:
Timestamp:
03/28/09 13:32:27 (4 years ago)
Author:
pv
Comment:

More notes and points of comparison

Legend:

Unmodified
Added
Removed
Modified
  • GitMigrationProposal

    v22 v23  
    1515  - Bzr: status, diff against last commit are fast enough, even for big working trees. History related commands are slow. Network operations are very inefficient (up to bzr 1.12 at least). 
    1616 
    17 == Merging == 
    18  
    19 XXX: merging in Bzr can be a bit confusing. Eg. how to find out what is the difference between two merged branches in the middle of the merge? 
    20  
    2117== Branches == 
    2218 
     
    3127 
    3228  - comparing branches is difficult, as they are in different repositories. For example, say one branch is the mainline (trunk), and one branch is a release branch, comparing, diffing them from the tool is awkward at best. git log/diff branch1..branch2 is extremely useful to follow what's happening in a branch, for review and so on. 
    33   - switching between branches is inconvenient. 
     29  - switching between branches in different repositories is inconvenient. 
    3430 
    3531Evaluation: 
    3632 
    3733  - Git's branches can be easily used as topic branches, and also as permanent ones. Switching between branches is very fast within the same working copy. 
    38   - Git's collaboration features appear to be the best of the three. 
     34  - Git's collaboration features for tracking what's going on in remote branches appear to be the best of the three. 
    3935  - Bzr's repository branches are clumsier than Git's for use as topic branches; requires cd'ing to a different working copy. Long URLs difficult to remember, and no way to list available branches from command line. 
    4036  - Hg's repository branches: similar to Bzr. 
    4137  - Hg's named branches: use as throwaway topic branches questionable, since they cannot be deleted. 
    42   - Hg's plugins: at least the localbranch one seemed to suffer from the 80%-20% problem. Also, it was not suitable for collaboration, as IIRC there was no way to publish the local branches separately. 
    43  
    44 Another consequence of those differences is that both bzr and hg use "simple" numbers for versioning (bzr emphasizes this much more than hg), but this breaks horribly when using branches: there is no simple ordering in a DAG anymore, and things like topological order can only be done for a known structure, that is the number -> internal id changes (a same version can refer to different things on different branches). This is extremely confusing in advanced scenario. Note that this happens in svn too: when you have several branches, svn revisions 'jump' for each branch, and they can't be used in any meaningful way. 
     38  - Hg's plugins that provide git-like branches: "non-standard" solutions. At least the localbranch one seemed to suffer from the 80%-20% problem. Also, it was not suitable for collaboration, as IIRC there was no way to publish the local branches separately. 
     39 
     40Another consequence of those differences is that Bzr uses "simple" numbers for versioning (HG also uses simple numbers for convenience in UI, alongside SHA hashes similar to git), but this breaks horribly when using branches: there is no simple ordering in a DAG anymore, and things like topological order can only be done for a known structure, that is the number -> internal id changes (a same version can refer to different things on different branches). This is extremely confusing in advanced scenario. Note that this happens in svn too: when you have several branches, svn revisions 'jump' for each branch, and they can't be used in any meaningful way. 
    4541 
    4642Git simply gives up the normal "simple revision" concept, and uses the internally used revision by default. In practice, this is not so much a problem, because git can refer to a specific change in many different ways: the internal number (sha1 checksum), parent ordering, time, etc...: 
    47  
    4843{{{ 
    4944# Diff between the working tree and the last commit on the current branch 
     
    5651git log --since="7 days" 
    5752}}} 
    58  
    59 To talk about a given change, one can simply tag it a simple name, use branches for review, etc... In my experience, the weird internal revision number feeling in git disappears quickly. 
    60  
    61 == explicit meta-data vs guessing == 
     53To talk about a given change, one can simply tag it a simple name, use branches for review, etc... In my (David) experience, the weird internal revision number feeling in git disappears quickly. However, in my experience (Pauli) one ends up pasting the SHA hashes especially when rebasing interactively against older revisions, and the "convenience" numbers on the revisions could be useful. 
     54 
     55Strangely enough, HG does not appear to have a syntax similar to HEAD^^ for referring quickly to changesets preceding current head. XXX: is this true? 
     56 
     57== Merging == 
     58 
     59Merging in Git/Hg: 
     60 
     61  - Fetch remote branch to local storage 
     62  - Merge the new branch/head to the local branch 
     63 
     64Merging in Bzr: 
     65 
     66  - Merge directly against remote. 
     67 
     68In both HG and Git the changesets to be merged are locally accessible in the normal way to commands "diff", "revert", etc., and it is easy to examine the csets to be merged. In Bzr, you apparently need to use a bit more awkward branch:URL syntax to refer to the remote branch, which also requires over-the-network operations. 
     69 
     70XXX: Is there in Bzr some other way to referer to the changesets to be merged? It appears that they *are* temporarily stored locally, but I couldn't figure out the proper syntax. 
     71 
     72== Publishing branches == 
     73 
     74Git, Bzr and HG support "dumb" read-only repositories served over plain HTTP. (Git requires running git update-server-info, though, after every push.) Also, for all of the three, there are free services (github, gitorius, launchpad, bitbucket, freehg) for publishing branches conveniently. 
     75 
     76== History rewriting == 
     77 
     78Attitude to history rewriting is perhaps the most controversial difference between Git and Bzr/HG. 
     79 
     80Git comes built-in with the "rebase" command, which is fairly easy to use. 
     81In Bzr and HG, similar features are available as extensions, though. 
     82 
     83XXX: I (Pauli) haven't tested the HG and Bzr rebase functionality carefully. Does it work well? 
     84 
     85== Explicit meta-data vs guessing == 
    6286 
    6387Another strong internal difference between git and bzr is how to deal with meta-data: file moves, tracking directories, etc... Git does not track any of this (git in particular cannot track empty directory). This has consequences on rename/merge interaction  (e.g. assuming one file foo.c in trunk renamed to foobar.c, but barfoo.c in branch1, what happens when branch1 and is merged into trunk ?). Git's approach advantages: 
     
    6690 - changing things from a patch, or from git itself results in exactly the same commit (assuming the changes are the same of course) 
    6791 
    68 The bzr advantages: 
     92The bzr/hg advantages: 
    6993 
    7094 - rename sometimes behaves more like people expect during merges. 
    7195 - git automatic detection of renames is based on heuristics, which sometimes fail. 
    7296 
     97Mercurial repository format also has a disadvantage when it comes to moving big files: when you move a file, the data currently in it becomes duplicated in the repository. So if you have a X MB file in the repository, after renaming it, you repository size has increased by X MB. (Bzr and Git do not have this problem.) 
     98 
    7399git usage of heuristics is a bit controversial: some people say that git behaves better for renames because of this, other the contrary. One potentially very useful feature is the automatic code move detection for code moves within files. For example, here is the output of git blame for one file of the talkbox git repo: 
    74  
    75100{{{ 
    76101^6f8dca2 setup.py  (David Cournapeau 2008-09-03 10:33:42 +0000  1) descr   = """Talkbox, to make your numpy environment speech aware ! 
     
    136161dc91bfef common.py (David Cournapeau 2009-03-26 18:02:24 +0900 61) INSTALL_REQUIRE = 'numpy' 
    137162}}} 
    138  
    139163As you can see, blame not only outputs the commit for each line, but also the original file. Note that the committer has never told git about code move: git automatically saw that there were some common code portions between this file and some other files at a previous revision. 
    140164 
     
    157181In svn, any of this operation is so slow and awkward that nobody does it. Points 2 and 3 are equally easy (tag is one command, and cherry picking is done through git cherry-pick). 
    158182 
     183== Keeping a "patch" up-to-date == 
     184 
     185XXX: the rebase feature allows one to keep a patch up-to-date easily, and also polish it. (Though it has the danger that you lose history...) 
     186 
    159187== Significant changes == 
    160188 
     
    164192 
    165193XXX 
     194 
     195XXX: Linux-like workflow, use of Signed-off-by 
    166196 
    167197= How to do the migration =