Support submodule-subrepo mappings
Created originally on Bitbucket by Zoltán Lehóczky
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:
- We have hg repo with hg subrepos.
- 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).
- 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?