multigit
multigit copied to clipboard
add a way to specify and clone dependencies
Specifying dependencies
A repo can specify its dependencies in the .mgit/<repo-name>.deps
file which looks like this:
dep1 dep2 ...
platform1: dep1 dep2 ...
platform2: dep1 dep2 ...
First line specifies common dependencies, following lines specify additional platform-specific dependencies. A dependency is either a name, origin/name or a full url. Deps are cloned recursively so only direct dependencies must be specified. A platform is either an os, arch, or os-arch. For dependencies specified by name alone, the base url of the dependant package is used in absence of a .baseurl file (that is because .baseurl and .origin files are usually not present in package repos but only in meta-repos, but at the same time we do want to be able to add the .deps file to the package repo).
OSes: windows, linux, osx. Archs: x86, x64.
New commands
mgit platform os|arch
mgit deps [-r|--recursive] pkg [os|arch|os-arch]
mgit clone-only pkg
Versioning discussion
We might need a way to specify version range compatibility for deps, but let's look at why people do that. The problem is that lib A has two libs that uses it, B and C. Lib B is too old to work with the latest version of lib A, but lib C is too new to work with an old enough version of lib A that lib B would accept. A compatibility range can potentially solve the problem by finding an intersection of accepted version ranges of all users of a lib and using the upper bound of that intersection. The problem with this idea is that by the time you figure out that your lib is too old and you want to restrict your dependency to an older version so that you stay compatible, it's not clear that 1) you have a bigger right to do so than other libs have to request a minimum version that is higher than what you're requesting as a maximum version, and 2) might be better to just upgrade your damn lib to avoid imposing that restriction.