Feature Request
Description
Resolve the search paths a command operates on from an existing .repos file (by default), rather than scanning the working directory.
- Further establishes commands' dependency on an existing
.repos file.
- The search paths a command looks for would be extracted from the
.repos file.
- Setting custom base paths would still be possible via the
--paths argument.
- This would promote
--file to the Common parameters.
Motivation
Today each command discovers repositories by scanning paths. If the workspace already declares its repositories in a .repos file, that file is the authoritative list — resolving search paths from it makes command behavior consistent and predictable across all subcommands, while --paths remains available for ad-hoc use.
Proposed Solution
usage: vcs <command> [-h] [--context N] [--debug] [-s] [-n] [-w N] [--file] [--repos] [--paths]
Common parameters:
--debug Show debug messages (default: False)
-s, --hide-empty, --skip-empty
Hide repositories with empty output (default: False)
-n, --nested Search for nested repositories (default: False)
-w N, --workers N Number of parallel worker threads (default: 20)
--file FILE_OR_URL Where to read the .repos file (default: "$(cwd)/.repos"). Incompatible with `--paths`
--repos List repositories which the command operates on (default: False)
--paths Base paths to look for repositories (default: the paths on the `.repos` file).
Incompatible with `--file`, setting this would overlook an existent `.repos` file
Typical use-cases
- Perform the command on the repositories listed in the
.repos file:
vcs diff --file ros2.repos
- Perform the command on a subset of the repositories listed in the
.repos file:
vcs diff --file ros2.repos --repos my_package_description
- Perform the command on a custom path:
vcs status --paths [~/ros2_ws/src/]
- Perform the command on specific repositories (search paths resolved from default
$(cwd)/.repos):
vcs branch --repos my_package_bringup # uses the filename of the package that must exist on the search paths
Notes
Moved from dirk-thomas/vcstool#296
Feature Request
Description
Resolve the search paths a command operates on from an existing
.reposfile (by default), rather than scanning the working directory..reposfile..reposfile.--pathsargument.--fileto the Common parameters.Motivation
Today each command discovers repositories by scanning paths. If the workspace already declares its repositories in a
.reposfile, that file is the authoritative list — resolving search paths from it makes command behavior consistent and predictable across all subcommands, while--pathsremains available for ad-hoc use.Proposed Solution
Typical use-cases
.reposfile:.reposfile:$(cwd)/.repos):vcs branch --repos my_package_bringup # uses the filename of the package that must exist on the search pathsNotes
.reposfile for all commands (which can be overridden via--paths).--fileto locate the.reposfile).Moved from dirk-thomas/vcstool#296