Hi,
The modern gitifyhg was, let's be honest, a glorified copy of git-remote-hg. At
some point in time it might have had some unique features or fixes, but that
hasn't been the case since a long long time.
Nowadays git-remote-hg has all the features of gitifyhg, but the same cannot be
said of the latter.
I already went in detail comparing the results and differences of both running
in both test suites, so I'm not going to go through that again because most of
the discrepancies are still trivial, or are already resolved.
The only difference worth mentioning is in the way both handle divergence, aka
non-fast-forwards, aka multiple heads.
The approach of gitifyhg, as I understand it, is that it doesn't force a push,
instead, it there's an error it catches it and localy strips the revisions that
were being pushed. This ensures that locally the multiple heads are not stored,
and once the user has either merged or rebased, the previous conflicting heads
wouldn't make the push fail again. While this approach has some merit, it
requires an extension.
The approach of git-remote-hg is to specify precisely what heads to push and
using a custom push() method, which can report if there will be an issue before
issuing the actual push. This means that even if there are multiple heads, the
extra heads don't have to be removed locally. It also means there's finer
control over notifications and options.
For example, the custom push function allows the use of --force, and --dry-run,
and each individual branch (or bookmark) gets a nice notification if a push was
forced or if a fetch is needed, even when running with --dry-run. If a
non-force push fails, the branches that caused it are reported.
In addition, this allows pushing new bookmarks even if the branch would have
multiple heads.
In gitifyhg none of that is possible; --force and --dry-run fail, and when a
non-force push fails, all the branches get the notification of
non-fast-forward.
git-remote-hg has received constant feedback and many people are using it now.
In fact, it's going to be distributed by default in Git v2.0 since it has been
proved to be solid and stable.
So it is time to accept this fact, salvage the most possible from gitifyhg,
abandon the project and move to git-remote-hg.
In order to make sure as few things as possible are lost I have made changes to
both projects to make it easier to compare them, and in the process I found a
bunch of issues in gitifyhg and fixed them.
This patch series is the result of this work.
With these patches applied I run the git-remote-hg test-suite, and these are the results.
5811-remote-hg-bidi.sh (Wstat: 256 Tests: 5 Failed: 3)
Failed tests: 3-5
Non-zero exit status: 1
t5812-remote-hg-hg-git.sh (Wstat: 256 Tests: 11 Failed: 11)
Failed tests: 1-11
Non-zero exit status: 1
t5810-remote-hg.sh (Wstat: 256 Tests: 34 Failed: 8)
Failed tests: 16-17, 20-23, 25-26
== remote update bookmark diverge ==
Doesn't support fetch-first reports.
== remote new bookmark multiple branch head ==
Cannot push a new bookmark if there are multiple heads in the branch.
== remote big push ==
Reports all branches as non-fast-forward:
! [rejected] master -> master (non-fast-forward)
! [rejected] branches/good_branch -> branches/good_branch (non-fast-forward)
! [rejected] branches/bad_branch -> branches/bad_branch (non-fast-forward)
! [rejected] bad_bmark1 -> bad_bmark1 (non-fast-forward)
! [rejected] bad_bmark2 -> bad_bmark2 (non-fast-forward)
! [rejected] good_bmark -> good_bmark (non-fast-forward)
! [rejected] branches/new_branch -> branches/new_branch (non-fast-forward)
! [rejected] new_bmark -> new_bmark (non-fast-forward)
While git-remote-hg reports the problems individiually:
1f23d0e..6f9aac3 branches/good_branch -> branches/good_branch
0aa76de..6658520 master -> master
0aa76de..c8f4933 good_bmark -> good_bmark
* [new branch] branches/new_branch -> branches/new_branch
* [new branch] new_bmark -> new_bmark
! [rejected] branches/bad_branch -> branches/bad_branch (non-fast-forward)
! [rejected] bad_bmark1 -> bad_bmark1 (non-fast-forward)
! [rejected] bad_bmark2 -> bad_bmark2 (non-fast-forward)
== remote big push fetch first ==
Similar issue but reporting fetch-first (all of them non-fast-forward).
== remote big push force ==
--force is not supported; the push fail reporting all of them non-fast-forward.
== remote big push dry-run ==
--dry-run is not supported.
== remote double failed push ==
Crashes.
== clone remote with null bookmark, then push ==
Crashes.
== git tags ==
== hg tags ==
== hg branch ==
All of these bidirectional tests have problems.
Solving these problems would require a major amount of work, and why go through
that if we already have git-remote-hg?
On the other hand running gitifyhg tests with git-remote-hg:
test_anonymous_branches.t ..... ok
test_clone_file_operations.t .. ok
test_author.t ................. ok
test_bookmarks.t .............. ok
test_clone.t .................. ok
test_notes.t .................. ok
test_push_tags.t .............. ok
test_pull.t ................... ok
test_special_cases.t .......... ok
test_spaces.t ................. ok
test_push.t ................... ok
All tests successful.
In fact there is a test that git-remote-hg passes and gitifyhg doesn't:
ok 8 - pull_from_bookmark # TODO known breakage vanished
So it is clear that git-remote-hg is the better solution, but is there anything
to salvage from gitifyhg?
The only thing I can think of is the tests, so I went one by one to see what
isn't been tested by git-remote-hg test suite. I made a list, and I can post it
here if you want, but in the only a few tests would be useful, so I ported
them.
https://github.com/felipec/git/commit/493612391cc590429fa1a76e6b2f96353156ee0b
https://github.com/felipec/git/commit/2e2c73938c70d02c3905a9f0e35222b9d7beae20
The only remaining tests that have not been ported are the ones that check
spaces in refs.
So I'm farily confident the git-remote-hg test suite covers what the gitifyhg
test suite covered. It might make sense to port a few things more so the tests
What do you think?
Felipe Contreras (15):
test: simplify python path stuff
test: simplify testgitifyhg hack
test: fix
user.name configuration
Fix Git body
Use Git information for tags
Fix order of file operations
Fix for temporary remotes
Allow non-fast-forward updates
test: fix broken && chain
test: simplify helpers
test: simplify hg user config
test: fix file quotes
Track the 'default' branch
Allow tags to be overridden
Port git-remote-hg author sanitizer
MANIFEST.in | 2 +-
git-remote-testgitifyhg | 19 -----------
gitifyhg/gitexporter.py | 14 ++++++--
gitifyhg/gitifyhg.py | 19 ++++++-----
gitifyhg/hgimporter.py | 59 +++++++++++++++++++--------------
gitifyhg/util.py | 5 +--
test/git-remote-gitifyhg | 7 ++++
test/test-lib.sh | 68 ++++++++++++---------------------------
test/test_anonymous_branches.t | 4 +--
test/test_author.t | 6 ++--
test/test_bookmarks.t | 3 ++
test/test_clone.t | 36 +++++++++++++++++++++
test/test_clone_file_operations.t | 4 +--
test/test_notes.t | 2 +-
test/test_pull.t | 2 +-
test/test_push.t | 29 +++++++++++++++--
test/test_push_tags.t | 15 +++------
test/test_spaces.t | 2 ++
test/test_special_cases.t | 10 +++---
19 files changed, 171 insertions(+), 135 deletions(-)
delete mode 100755 git-remote-testgitifyhg
create mode 100755 test/git-remote-gitifyhg
--
1.9.2+fc1.20.g204a630