In a recent e-mail[1] it was suggested that gitifyhg and git-remote-hg had many
differences, and that some users might be best served by using gitifyhg. While
that e-mail was answered properly, I would like to point out what are the
actual differences that affect users, not the ones that are particular to the
state of the code this week, but rather the ones that are inherent due to the
design and/or development process.

First of all, it's worth mentioning that much of the code of gitifyhg was
simply copied from git-remote-hg. One example is the get_filechanges() function
which was introduced in v6 of the initial patch series[2], after extensive
profiling. The gitifyhg developers simply copied the function without
mentioning where it came from. And like this one, there are numerous examples.

== Code changes ==

In terms of design, they are vastly similar (not surprising since gitifyhg is
based on remote-hg), however remote-hg tries to have a minimal code-base, 
avoid hacks, and tries to minimize and isolate changes to avoid regressions -- 
is typical for git.git code --, whereas gitifyhg tries to introduce features as
soon as possible, and fix the possible issues later on.

A succint example is the introduction of a custom function to write tags:


Then the inevitable fixes come (some after a major version was released):


Contrast with the single commit in remote-hg, which is simpler, cleaner, passes
the same tests, and still, it's not merged, nor on the queue (it's on the
'next' branch):


== Development practices ==

Each patch of remote-hg is reviewed in the git.git mailing list before being
merged to the mainline, the stages are: fc/remote/hg-next -> fc/master
(patch review) -> pu -> next -> master. On the other hand, gitifyhg doesn't
have patch review through a mailing list[4], nor different development branches;
everything is committed to 'master'.

Features are important for users, but more important than features is that what
used to work continues to work, and in the same way, and remote-hg's practices
help to achieve that.

== Testing ==

It's impossible to test all Mercurial repositories, or even a significant chunk
of them, which is why it's a good idea to rely on the testing and gathered
tricks of other conversion projects. By far the most widely used tool is
hg-git, which already has a decent test cases, it makes sense then to use these
tests cases and make sure that the output of a conversion tool matches the one
of hg-git, and that's exactly what remote-hg does.

gitifyhg has continuous testing, but it's more important to have the right 

== Features ==

All the features of gitifyhg have been implemented in remote-hg, with the
exception of push rollback. However, this feature is not needed if only certain
commits are pushed; this way there's no need to rollback the previous commits
that failed; they would be simply ignored for the next push.

Here are the commits that implement them:


Noteids (SHA-1):

Changing alias:

The first two will be merged, but the last one won't; we can choose either the
alias or the URL as a unique identifier, and choosing the alias makes more

This means as a user, there's no reason to use gitifyhg, since the same
features are available in remote-hg. And as a developer, one can simply pick
these missing patches (one?) and maintain a friendly fork.

To make sure that remote-hg can indeed act like gitifyhg for all intents and
purposes I created a branch to do so:


The changes are minimal:

  contrib/remote-helpers/git-remote-hg | 57 
   1 file changed, 34 insertions(+), 23 deletions(-)

After these patches, gitifyhg's test suite passes **all** the tests (except a
trivial one).

== Minor differences ==

What follows are some tedious comparisons between both test suites, and an
explanation about the difference.

= remote-hg =

== cloning with branches ==


remote-hg closes the current branch (next), gitifyhg doesn't.

== cloning with bookmarks ==


remote-hg closes the current bookmark (feature-a), gitifyhg doesn't.

== authors ==

   H G Wells <we...@example.com>
  -test <unknown>
  -test <t...@example.com>
  +test <>
  +test <t...@example.com (comment)>
   Unknown <t...@example.com>
   name <t...@example.com>
   name <t...@example.com>
  -test <unknown>
  +test <>
   test <t...@example.com>
   test <t...@example.com>
  -test <unknown>
  +test <test at example dot com>
   Unknown <t...@example.com>

remote-hg uses <unknown> when there's no e-mail, gitifyhg <>. Also, remote-hg
removes garbage after the email, gitifyhg doesn't <t...@example.com (comment)>.

== strip ==

  Cloning into 'gitrepo'...
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  saved backup bundle to /home/felipec/dev/git/t/trash 
  WARNING: "Branch 'default' has more than one head, consider merging"
  WARNING: "Branch 'default' has more than one head, consider merging"
  warning: Not updating refs/hg/origin/bookmarks/master (new tip 
7a424409fcae0c8855f3d887bf1c2c376c00f09c does not contain 
  fatal: Error while running fast-import                        

Funny how the gitifyhg people claimed SHA-1 ids were necessary, yet when the
revision ids of Mercurial change, gitifyhg fails.

= remote-hg bidi =

== git tags ==

  -@  changeset:   3:4c73577597f09b1bbd90399e85ac81bd0658e9f2
  +@  changeset:   3:5a84c01d4d40e697a879c54f6b12e516d24bbfc7
   |  tag:         tip
   |  parent:      2:9f22c99d619819e20669949f318491eb47741d5f
   |  parent:      -1:0000000000000000000000000000000000000000
   |  manifest:    3:56f3afad7f2dafcb324b2b3a2741e5750d3c9820
  -|  user:        felipec@nysa
  +|  user:        Unknown <felipec@nysa>
   |  date:        Thu Apr 11 00:57:42 2013 +0000
   |  files:       .hgtags
   |  extra:       branch=default

gitifyhg doesn't restore the original author properly.

== hg branch ==

  alpha: No such file or directory
  abort: no files to copy

Probably some issues checking out and restoring the original branch/bookmark.

== hg tags ==

  abort: not at a branch head (use -f to force)


= remote-hg hg-git =

All these tests fail, so it's impossible to compare to the well known hg-git.

= gitifyhg =

== test_author_no_email ==

  no email supplied <>
  no email supplied <unknown>

Trivial e-mail difference (silenced with [5]).

== test_author_abuse_quotes ==

  totally <bad  quote can be used in hg>
  totally <unknown>

Irrelevant e-mail difference.

== test_clone_relative ==

  IOError: [Errno 21] Is a directory: path(u'XXX/git_dir/hg_base/.')

remote-hg doesn't create a local clone when it's not needed
(silenced with [10]).

== test_clone_linear_branch ==
== test_clone_branch_with_spaces ==
== test_clone_bookmark ==
== test_clone_bookmark_with_spaces ==
== test_clone_divergent_bookmarks ==
== test_clone_bookmark_not_at_tip ==

All these fail because gitifyhg always checks out the 'default' branch, and
ignores the 'master' ref (silenced with [7][8]).

== test_clone_close_branch ==

Ditto. Plus gitifyhg shows closed branches (silenced with [9]).

== test_pull_rename_remote ==

remote-hg allows changing the URL without recloning, gitifyhg allows changing
the alias (silenced with [12]).

== test_simple_push_updates_notes_after_contentful_pull ==
== test_simple_push_updates_remote ==

gitifyhg always checks out 'master' (silenced by [7]).

== test_push_conflict_default ==
== test_push_conflict_default_double ==
== test_push_conflict_default_double_non_english ==
== test_push_conflict_named_branch ==

gitifyhg barfs when pushing a new head to a branch (the fix [11] might be
merged to remote-hg). Also, these tests need a proxy clone (silenced with

== test_push_to_bookmark ==
== test_push_to_bookmark_with_spaces ==
== test_push_up_to_date ==

gitifyhg always checks out 'master' (silenced with [7]).

== test_push_tag_with_previous_commits ==
== test_push_only_new_tag ==

gitifyhg doesn't allow repeated tags (Mercurial does)(silenced with [6]).

[1] http://article.gmane.org/gmane.comp.version-control.git/219893
[2] http://article.gmane.org/gmane.comp.version-control.git/208990
[4] https://groups.google.com/forum/?fromgroups=#!forum/gitifyhg
[5] https://github.com/felipec/git/commit/77d12ea
[6] https://github.com/felipec/git/commit/415da9e
[7] https://github.com/felipec/git/commit/4c0f7e2
[8] https://github.com/felipec/git/commit/2fdca59
[9] https://github.com/felipec/git/commit/8dfcee1
[10] https://github.com/felipec/git/commit/4d023e5
[11] https://github.com/felipec/git/commit/006b090
[12] https://github.com/felipec/git/commit/316c330
[13] https://github.com/felipec/git/commit/9545d66

Felipe Contreras
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to