Skip to content

Proposal: resolve the search paths from a ".repos" specification (by default) #115

Description

@caioaamaral

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions