Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation issue about the -r, --singular-remote option #359

Closed
maximerety opened this issue Jun 20, 2022 · 4 comments · Fixed by #383
Closed

Documentation issue about the -r, --singular-remote option #359

maximerety opened this issue Jun 20, 2022 · 4 comments · Fixed by #383

Comments

@maximerety
Copy link
Contributor

maximerety commented Jun 20, 2022

I took the liberty of correcting some documentation issues here: #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:

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
Copy link
Contributor Author

maximerety commented Jun 20, 2022

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 983989d (a commit which wasn't supposed to introduce a breaking change IMHO).

@dmerejkowsky
Copy link
Collaborator

dmerejkowsky commented Jun 21, 2022

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

@vonpupp
Copy link
Contributor

vonpupp commented Jul 4, 2022

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

@vonpupp
Copy link
Contributor

vonpupp commented Jul 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants