tsrc icon indicating copy to clipboard operation
tsrc copied to clipboard

Documentation issue about the `-r, --singular-remote` option

Open maximerety opened this issue 2 years ago • 4 comments

I took the liberty of correcting some documentation issues here: https://github.com/your-tools/tsrc/pull/358

While doing so, I noticed a mismatch between what the cli supports and what the documentation says about the -r, --singular-remote option.

Here are excerpts from the cli's help messages (v2.7.1) on macOS:

❯ tsrc init --help
usage: tsrc init [-h] [-w WORKSPACE_PATH] [--branch MANIFEST_BRANCH] [--shallow] [-r SINGULAR_REMOTE] [--clone-all-repos] [-g GROUPS [GROUPS ...]] [-j NUM_JOBS] manifest_url

optional arguments:
  -r SINGULAR_REMOTE, --singular-remote SINGULAR_REMOTE
                        only use this remote when cloning repositories


❯ tsrc sync --help
usage: tsrc sync [-h] [-w WORKSPACE_PATH] [-g GROUPS [GROUPS ...]] [--all-cloned] [-r REGEX] [-i IREGEX] [--force] [--no-update-manifest] [-j NUM_JOBS]

optional arguments:
  -r REGEX              Include only repositories matching the regex

From this, I gather that the -r, --singular-remote option is only available on tsrc init but not on tsrc sync.

The documentation says otherwise in several places:

  • https://github.com/your-tools/tsrc/blob/6c162b43/docs/guide/remotes.md?plain=1#L74-L84
  • https://github.com/your-tools/tsrc/blob/6c162b4/docs/ref/workspace-config.md?plain=1#L25-L27

I am not sure what the initial intent was, but we should either fix the documentation, or add the --singular-remote option to the tsrc sync command in a way that will not collide with the existing -r REGEX option.

maximerety avatar Jun 20 '22 14:06 maximerety

I figured it is even weirder than that...

The option used to be named --remote in the code base (and in the changelog when introduced in 2.1.0), while being referred as both --remote and --singular-remote in the docs.

It was then renamed to --singular-remote in the code base in 983989d9 (a commit which wasn't supposed to introduce a breaking change IMHO).

maximerety avatar Jun 20 '22 15:06 maximerety

a commit which wasn't supposed to introduce a breaking change IMHO)

Yup. My bad. Should have test more carefully - most of the automatic tests use the --long-form-option format for clarity, which can lead to such mishaps when short options like -r are used

dmerejkowsky avatar Jun 21 '22 08:06 dmerejkowsky

I am having this very same issue. I didn't know what was really going on until I found this issue.

vonpupp avatar Jul 04 '22 16:07 vonpupp

I submitted a PR to include the -r feature in the sync command.

vonpupp avatar Jul 06 '22 14:07 vonpupp