Multi, Mono, Meta, Manifest – Composite Repository?

| Created | Modified

There was this discussion about whether to use Mono- or Multi-Repositories? I won’t pick it up again.

Some cool people suggested: why not use the best of both worlds and use meta-repos?!

I Was Interested in “Meta-Repo” Tooling

I asked myself how these tools would solve problems and gave some of them a try:

In the end, most tools mentioned here do not focus on workflow problems; rather, they introduce new manifests or config files. :(

But Basically git submodule is a Meta-Repo Since We Have .gitmodules!

Yes, that’s absolutely valid. .gitmodules basically behaves like a multiple repository manifest (and you can set submodules also to active:false).

But Isn’t There More to It?

Let’s Redefine Our Problem!

We want git submodules and an umbrella to add some workflow features. Wouldn’t that be wrong?

I did a search and came up with git-meta (not to be mistaken for other projects of the same name). They also have a nice presentation that brings up the most important thoughts (WATCH IT!).

Unfortunately, GitLab documentation did not return results on how to better solve where to put merge requests on meta-repos, etc.

And then there is the more established meta, which has 1.4K stars (only?). But they try to reinvent .gitmodules and add a ton of (un)related features, like mono-meta-repo project migration. And they even use .meta in their own repository to define plugin-dependencies #facepalm.

The main issues with meta-repos are still GitLab and how to integrate your workflow (like multiple merge requests; microservices should be decoupled and shouldn’t break!).

I don’t know what tool is better—try it out!

So, Do .gitmodules Alone Make a Repository a Meta-Repository?

Yes and no. It depends on whether you treat dependencies like 3rd party libraries or as an actual composite of multi-repos you need to work on.

Meta-Repos are a workaround for big, too-big-to-be-fun mono-repositories and a half-baked solution for composite workspaces (like those needed for microservices), since the necessary umbrella workflows are not integrated into GitHub or GitLab. If the problem doesn’t hurt, don’t try to solve it, as you’ll create new problems. You can still use Virtual Workspaces, like linking repo folders in your IDE or via symlink. Just try to stay focused on one task before having multiple workspaces open at the same time.

Is ‘Meta-Repo’ a Buzzword?

Yes. Basically, it’s multi-repo with a new view on the workflow issues of having a composite repository, and not much new otherwise.

You can still use git subtree in your project, but keep in mind that when a repository is shared among many projects/workspaces, it may diverge since upstreams are treated as second-class citizens, and it’s harder to maintain when branching from dev for new features.

But then again, git-meta says in their project description:

Repository for the git-meta project – build your own monorepo using Git submodules

Multi, Mono, Meta - Composite Repo?

Further Readings