pull: option to exclude some directories
An option to exclude some directories while converting from Git to Mercurial would be very useful to me, and I hope it would be interesting for other users.
I realize it would probably be complicated to make it bidirectional, and that various mechanisms would have to be set in place for repeatability, so that subsequent pulls are possible.
My use-case is tracking the GitLab upstream Git repository into the Heptapod Mercurial repository. To elaborate, GitLab has two Git repositories:
-
gitlab, where development actually happens, has all the free and non free software content. The non free content is kept in a couple of
ee
directories (for Enterprise Edition). -
gitlab-foss is the above with the Free and Open Source parts. It is kept up to date by a periodic bot that extracts the free parts from
gitlab
intogitlab-foss
as big opaque commits. Here is an example.
We are currently using hg-git on the gitlab-foss
repository to import the changes in Heptapod. It would be way better to be able to import directly from the gitlab
repository, excluding of course the ee
directories. We would probably need some strong guarantees that the exclusion stays enabled.
Currently, we simply import upstream release tags, then merge and fix everything in one big changeset (conflicts for a few dozen files, API breakage etc.).
A direct import capability is probably also necessary if we want to track upstream before release, because I think that the gitlab > gitlab-foss
extraction also loses some of the relationship between the main and stable/release branches: hg log -r ancestor(release1, release2)
has been giving me irrelevant results since they adopted this extraction policy.
Any thoughts?