Support submodule-subrepo mappings

Issue #222 new
Zoltán Lehóczky
created an issue

Currently git submodules are transformed into git subrepos when syncing from git to hg; the other way around subrepos are just discarded. I propose an improved way of handling submodules/repos if those repos also have git/hg mirrors.

There could be an optional config enable this behaviour and to map git submodule URLs to hg subrepo URLs. Then the following would happen, starting with the hg side for example:

  1. We have hg repo with hg subrepos.
  2. Gexport not only converts the super repo to git, but also the subrepos and stores them internally together with the super repo's git representation. The latter's .submodules config references the git URLs (remember we configured where the git mirrors of our hg subrepos are) and internally the changesets of the submodules correspond to the hg subrepos' commits (using their converted versions too).
  3. If a commit is added to a subrepo and then to the super repo then both are again exported to git.

The same happens from git too, the other way around.

We run Git-hg Mirror and it would simplify things greatly if composed repos could also be easily synced. Now you have to keep submodules only (and even use those from hg) due to the lack of suitable bridging.

What do you think?