{"thread":{"id":"33470","subject":"gitifyhg vs. git-remote-hg","startedAt":"2013-04-11T02:49:53Z","lastAt":"2013-04-11T02:49:53Z","messageCount":1,"participants":["Felipe Contreras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"213886","messageId":"516624d13a6ea_66fcc5de1023665@nysa.mail","threadId":"33470","inReplyTo":null,"subject":"gitifyhg vs. git-remote-hg","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T02:49:53Z","receivedAt":"2013-04-11T02:49:53Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nIn a recent e-mail[1] it was suggested that gitifyhg and git-remote-hg had many\ndifferences, and that some users might be best served by using gitifyhg. While\nthat e-mail was answered properly, I would like to point out what are the\nactual differences that affect users, not the ones that are particular to the\nstate of the code this week, but rather the ones that are inherent due to the\ndesign and/or development process.\n\nFirst of all, it's worth mentioning that much of the code of gitifyhg was\nsimply copied from git-remote-hg. One example is the get_filechanges() function\nwhich was introduced in v6 of the initial patch series[2], after extensive\nprofiling. The gitifyhg developers simply copied the function without\nmentioning where it came from. And like this one, there are numerous examples.\n\n== Code changes ==\n\nIn terms of design, they are vastly similar (not surprising since gitifyhg is\nbased on remote-hg), however remote-hg tries to have a minimal code-base, \navoid hacks, and tries to minimize and isolate changes to avoid regressions -- as\nis typical for git.git code --, whereas gitifyhg tries to introduce features as\nsoon as possible, and fix the possible issues later on.\n\nA succint example is the introduction of a custom function to write tags:\n\nhttps://github.com/buchuki/gitifyhg/commit/9a89296\n\nThen the inevitable fixes come (some after a major version was released):\n\nhttps://github.com/buchuki/gitifyhg/commit/8cd638b\nhttps://github.com/buchuki/gitifyhg/commit/1ce980a\nhttps://github.com/buchuki/gitifyhg/commit/885dd84\n\nContrast with the single commit in remote-hg, which is simpler, cleaner, passes\nthe same tests, and still, it's not merged, nor on the queue (it's on the\n'next' branch):\n\nhttps://github.com/felipec/git/commit/b565809\n\n== Development practices ==\n\nEach patch of remote-hg is reviewed in the git.git mailing list before being\nmerged to the mainline, the stages are: fc/remote/hg-next -> fc/master\n(patch review) -> pu -> next -> master. On the other hand, gitifyhg doesn't\nhave patch review through a mailing list[4], nor different development branches;\neverything is committed to 'master'.\n\n\nFeatures are important for users, but more important than features is that what\nused to work continues to work, and in the same way, and remote-hg's practices\nhelp to achieve that.\n\n== Testing ==\n\nIt's impossible to test all Mercurial repositories, or even a significant chunk\nof them, which is why it's a good idea to rely on the testing and gathered\ntricks of other conversion projects. By far the most widely used tool is\nhg-git, which already has a decent test cases, it makes sense then to use these\ntests cases and make sure that the output of a conversion tool matches the one\nof hg-git, and that's exactly what remote-hg does.\n\ngitifyhg has continuous testing, but it's more important to have the right tests.\n\n== Features ==\n\nAll the features of gitifyhg have been implemented in remote-hg, with the\nexception of push rollback. However, this feature is not needed if only certain\ncommits are pushed; this way there's no need to rollback the previous commits\nthat failed; they would be simply ignored for the next push.\n\nHere are the commits that implement them:\n\nNotes:\nhttps://github.com/felipec/git/commit/e7234dc\n\nNoteids (SHA-1):\nhttps://github.com/felipec/git/commit/663704d\n\nChanging alias:\nhttps://github.com/felipec/git/commit/316c330\n\nThe first two will be merged, but the last one won't; we can choose either the\nalias or the URL as a unique identifier, and choosing the alias makes more\nsense.\n\nThis means as a user, there's no reason to use gitifyhg, since the same\nfeatures are available in remote-hg. And as a developer, one can simply pick\nthese missing patches (one?) and maintain a friendly fork.\n\nTo make sure that remote-hg can indeed act like gitifyhg for all intents and\npurposes I created a branch to do so:\n\nhttps://github.com/felipec/git/tree/fc/remote/hg-gitifyhg-compat\n\nThe changes are minimal:\n\n  contrib/remote-helpers/git-remote-hg | 57 ++++++++++++++++++++++++++++++++++-----------------------\n   1 file changed, 34 insertions(+), 23 deletions(-)\n\nAfter these patches, gitifyhg's test suite passes **all** the tests (except a\ntrivial one).\n\n== Minor differences ==\n\nWhat follows are some tedious comparisons between both test suites, and an\nexplanation about the difference.\n\n\n= remote-hg =\n\n== cloning with branches ==\n\n  -next\n  -refs/heads/next\n  +zero\n  +refs/heads/master\n\nremote-hg closes the current branch (next), gitifyhg doesn't.\n\n== cloning with bookmarks ==\n\n  -feature-a\n  -refs/heads/feature-a\n  +zero\n  +refs/heads/master\n\nremote-hg closes the current bookmark (feature-a), gitifyhg doesn't.\n\n== authors ==\n\n   H G Wells <wells@example.com>\n  -test <unknown>\n  -test <test@example.com>\n  +test <>\n  +test <test@example.com (comment)>\n   Unknown <test@example.com>\n   name <test@example.com>\n   name <test@example.com>\n  -test <unknown>\n  +test <>\n   test <test@example.com>\n   test <test@example.com>\n  -test <unknown>\n  +test <test at example dot com>\n   Unknown <test@example.com>\n\nremote-hg uses <unknown> when there's no e-mail, gitifyhg <>. Also, remote-hg\nremoves garbage after the email, gitifyhg doesn't <test@example.com (comment)>.\n\n== strip ==\n\n  Cloning into 'gitrepo'...\n  1 files updated, 0 files merged, 0 files removed, 0 files unresolved\n  saved backup bundle to /home/felipec/dev/git/t/trash directory.test-hg/tmp/hgrepo/.hg/strip-backup/06c5e5718f17-backup.hg\n  WARNING: \"Branch 'default' has more than one head, consider merging\"\n  WARNING: \"Branch 'default' has more than one head, consider merging\"\n  warning: Not updating refs/hg/origin/bookmarks/master (new tip 7a424409fcae0c8855f3d887bf1c2c376c00f09c does not contain 796e103bcc0968ae99db18e7e612a7fb1fbb81cf)\n  fatal: Error while running fast-import\t\t\t\n\nFunny how the gitifyhg people claimed SHA-1 ids were necessary, yet when the\nrevision ids of Mercurial change, gitifyhg fails.\n\n= remote-hg bidi =\n\n== git tags ==\n\n  -@  changeset:   3:4c73577597f09b1bbd90399e85ac81bd0658e9f2\n  +@  changeset:   3:5a84c01d4d40e697a879c54f6b12e516d24bbfc7\n   |  tag:         tip\n   |  parent:      2:9f22c99d619819e20669949f318491eb47741d5f\n   |  parent:      -1:0000000000000000000000000000000000000000\n   |  manifest:    3:56f3afad7f2dafcb324b2b3a2741e5750d3c9820\n  -|  user:        felipec@nysa\n  +|  user:        Unknown <felipec@nysa>\n   |  date:        Thu Apr 11 00:57:42 2013 +0000\n   |  files:       .hgtags\n   |  extra:       branch=default\n\ngitifyhg doesn't restore the original author properly.\n\n== hg branch ==\n\n  alpha: No such file or directory\n  abort: no files to copy\n\nProbably some issues checking out and restoring the original branch/bookmark.\n\n== hg tags ==\n\n  abort: not at a branch head (use -f to force)\n\nDitto.\n\n= remote-hg hg-git =\n\nAll these tests fail, so it's impossible to compare to the well known hg-git.\n\n= gitifyhg =\n\n== test_author_no_email ==\n\n  no email supplied <>\n  no email supplied <unknown>\n\nTrivial e-mail difference (silenced with [5]).\n\n== test_author_abuse_quotes ==\n\n  totally <bad  quote can be used in hg>\n  totally <unknown>\n\nIrrelevant e-mail difference.\n\n== test_clone_relative ==\n\n  IOError: [Errno 21] Is a directory: path(u'XXX/git_dir/hg_base/.')\n\nremote-hg doesn't create a local clone when it's not needed\n(silenced with [10]).\n\n== test_clone_linear_branch ==\n== test_clone_branch_with_spaces ==\n== test_clone_bookmark ==\n== test_clone_bookmark_with_spaces ==\n== test_clone_divergent_bookmarks ==\n== test_clone_bookmark_not_at_tip ==\n\nAll these fail because gitifyhg always checks out the 'default' branch, and\nignores the 'master' ref (silenced with [7][8]).\n\n== test_clone_close_branch ==\n\nDitto. Plus gitifyhg shows closed branches (silenced with [9]).\n\n== test_pull_rename_remote ==\n\nremote-hg allows changing the URL without recloning, gitifyhg allows changing\nthe alias (silenced with [12]).\n\n== test_simple_push_updates_notes_after_contentful_pull ==\n== test_simple_push_updates_remote ==\n\ngitifyhg always checks out 'master' (silenced by [7]).\n\n== test_push_conflict_default ==\n== test_push_conflict_default_double ==\n== test_push_conflict_default_double_non_english ==\n== test_push_conflict_named_branch ==\n\ngitifyhg barfs when pushing a new head to a branch (the fix [11] might be\nmerged to remote-hg). Also, these tests need a proxy clone (silenced with\n[10]).\n\n== test_push_to_bookmark ==\n== test_push_to_bookmark_with_spaces ==\n== test_push_up_to_date ==\n\ngitifyhg always checks out 'master' (silenced with [7]).\n\n== test_push_tag_with_previous_commits ==\n== test_push_only_new_tag ==\n\ngitifyhg doesn't allow repeated tags (Mercurial does)(silenced with [6]).\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/219893\n[2] http://article.gmane.org/gmane.comp.version-control.git/208990\n[3] https://github.com/buchuki/gitifyhg/commit/a46d518e2b8df5e8339c8caa9fa113642bc7ac3a\n[4] https://groups.google.com/forum/?fromgroups=#!forum/gitifyhg\n[5] https://github.com/felipec/git/commit/77d12ea\n[6] https://github.com/felipec/git/commit/415da9e\n[7] https://github.com/felipec/git/commit/4c0f7e2\n[8] https://github.com/felipec/git/commit/2fdca59\n[9] https://github.com/felipec/git/commit/8dfcee1\n[10] https://github.com/felipec/git/commit/4d023e5\n[11] https://github.com/felipec/git/commit/006b090\n[12] https://github.com/felipec/git/commit/316c330\n[13] https://github.com/felipec/git/commit/9545d66\n\n-- \nFelipe Contreras\n"}]}