Manifest configuration¶
The manifest configuration must be stored in a file named manifest.yml, using
YAML syntax.
It is always parsed as a mapping. Here's an example:
repos:
- url: git@gitlab.local:proj1/foo
dest: foo
branch: next
remotes:
- name: origin
url: git@gitlab.local:proj1/bar
- name: upstream
url: git@github.com:user/bar
dest: bar
branch: master
sha1: ad2b68539c78e749a372414165acdf2a1bb68203
- url: git@gitlab.local:proj1/app
dest: app
tag: v0.1
copy:
- file: top.cmake
dest: CMakeLists.txt
- file: .clangformat
symlink:
- source: app/some_file
target: ../foo/some_file
In this example:
- First,
proj1/foowill be cloned into<workspace>/foousing thenextbranch. - Then,
proj1/barwill be cloned into<workspace>/barusing themasterbranch, and reset toad2b68539c78e749a372414165acdf2a1bb68203. - Finally:
proj1/appwill be cloned into<workspace>/appusing thev0.1tag,top.cmakewill be copied fromproj1/app/top.cmaketo<workspace>/CMakeLists.txt,.clang-formatwill be copied fromproj1/app/to<workspace>/, and- a symlink will be created from
<workspace>/app/some_fileto<workspace>/foo/some_file.
Top fields¶
repos(required): list of repositories to clonegroups(optional): list of groups
repos¶
Each repository is also a mapping, containing:
- Either:
urlif you just need one remote namedorigin- A list of remotes with a
nameandurl. In that case, the first remote will be used for cloning the repository.
dest(required): relative path of the repository in the workspacebranch(optional): The branch to use when cloning the repository (defaults tomaster)tag(optional):- When running
tsrc init: Project will be cloned at the provided tag. - When running
tsrc sync: If the project is clean, project will be reset to the given tag, else a warning message will be printed.
- When running
sha1(optional):- When running
tsrc init: Project will be cloned, and then reset to the given sha1. - When running
tsrc sync: If the project is clean, project will be reset to the given sha1, else a warning message will be printed.
- When running
ignore_submodules(optional, default=false):- When running
tsrc init: ifignore_submodulesistrue, do not recursively clone submodules. - When running
tsrc sync: ifignore_submodulesistrue, do not initialize or update submodules. to the given sha1, else a warning message will be printed.
- When running
copy(optional): A list of mappings withfileanddestkeys.symlink(optional): A list of mappings withsourceandtargetkeys.
See the Using fixed references and the Performing file system operations guides for details about how and why you would use the tag, sha1, copy or symlink fields.
groups¶
The groups section lists the groups by name. Each group should have a repos field
containing a list of repositories (only repositories defined in the repos section are allowed).
The groups can optionally include other groups, with a includes field which should be
a list of existing group names.
The group named default, if it exists, will be used to know which repositories to clone
when using tsrc init and the --group command line argument is not used.
Example:
repos:
- dest: a
url: ..
- dest: b
url: ..
- dest: bar
url: ..
- dest: baz
url: ..
groups:
default:
repos: [a, b]
foo:
repos: [bar, baz]
includes: [default]
$ tsrc init <manifest_url>
# Clones a, b
$ tsrc init <manifest_url> --group foo
# Clones a, b, bar and baz
Note that tsrc init records the names of the groups it was invoked
with, so that tsrc sync re-uses them later on. This means that if you
want to change the groups used, you must re-run tsrc init with the new
group list.
Note
More information about how to use groups is available in the relevant guide.