git-aggregator and doodba#
odx reads and writes the files of
git-aggregator (repos.yaml) and
doodba (addons.yaml), so existing
projects can move over gradually.
Import#
$ odx import # repos.yaml (+ addons.yaml next to it)
$ odx import repos.yaml addons.yaml
prints the equivalent [[tool.odx.repositories]] tables:
repos.yaml |
|
|---|---|
target directory key ( |
|
first merge ( |
|
|
|
a commit ( |
|
a branch on the same remote |
|
a branch on another remote |
|
|
|
|
accepted and ignored (odx fetches into a shared object cache) |
|
not imported (warning) |
addons.yaml |
|
addons.yaml documents with |
skipped (warning) |
Everything that cannot be represented is reported as a warning on standard
error. odx import --write adds the repositories to pyproject.toml instead
of printing them, skipping URLs that are already configured; when the file
has no [tool.odx] table yet, it is created with --odoo-version or the
first base branch as the series.
Export#
$ odx export # writes repos.yaml and addons.yaml in the project root
$ odx export --stdout
writes the files back from [tool.odx], deterministically and with a header
marking them as generated. The repository URL becomes remote origin;
branches from other URLs get a remote named after the URL’s owner. GitLab
repositories use refs/merge-requests/N/head. Exporting and importing again
yields the same repositories, merges, targets and addon lists.
gitaggregate drop-in#
$ odx git-aggregate -c repos.yaml # or the standalone git-aggregate-rs
$ odx git-aggregate -c repos.yaml -d '*/sale-*' -j 8
$ odx git-aggregate -c repos.yaml -e --env-file .env -p
odx git-aggregate (and the git-aggregate-rs package) runs a repos.yaml
the way gitaggregate does, on the odx engine: every remote is fetched once
into the shared cache, concurrently, and each target directory becomes a
working tree of that cache with the merges applied in order. Target
directories are relative to the current directory, as with gitaggregate.
Option |
Effect |
|---|---|
|
the |
|
only target directories matching the fnmatch pattern |
|
expand |
|
|
|
discard local changes; replace directories odx did not create |
|
push the result to |
|
repositories at once (default: number of CPUs) |
|
|
|
rebase the merges instead of creating merge commits |
|
run |
|
resolve conflicts with mergiraf ( |
|
summary on stdout (schema 1) |
Differences from gitaggregate:
Target directories are detached working trees of the cache:
git log,git diffandgit statuswork, but the remotes are not configured in them and the target branch only exists on the push remote.Directories created by
gitaggregateare replaced only with-f.Every merge is a merge commit, as with
gitaggregate, but never a fast-forward, so commit ids differ;--rebaserebases the merges instead, for a linear history. Either way the resulting trees are identical, which CI checks against git-aggregator 4.1.With
-e, an unset variable is left as written with a warning.show-closed-prsandshow-all-prsland in roadmap phase 7.
The cache and local clones are shared with odx aggregate (see
Command line).