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

Sync everything when there are groups #360

Open
vonpupp opened this issue Jul 4, 2022 · 2 comments
Open

Sync everything when there are groups #360

vonpupp opened this issue Jul 4, 2022 · 2 comments

Comments

@vonpupp
Copy link
Contributor

vonpupp commented Jul 4, 2022

Hello,

I have the following manifest:

repos:
  - dest: org
    branch: main
    remotes:
    - name: origin
      url: git@gitlab.com:vonpupp-org/org.git
    - name: https
      url: https://vonpupp:<token>@gitlab.com/vonpupp-org/org.git
    - name: nas
      url: ssh://nas/share/repos/gitlab.com:vonpupp-org:org.git
  - dest: org-media
    branch: main
    remotes:
    - name: origin
      url: git@gitlab.com:vonpupp-org/org-media.git
    - name: https
      url: https://vonpupp:<token>@gitlab.com/vonpupp-org/org-media.git
    - name: nas
      url: ssh://nas/share/repos/gitlab.com:vonpupp-org:org-media.git
  - dest: albertdelafuente.com-hugo-refined
    branch: master
    remotes:
    - name: origin
      url: git@gitlab.com:albertdelafuentecom/albertdelafuente.com-hugo-refined.git
    - name: https
      url: https://vonpupp:<token>@gitlab.com/albertdelafuentecom/albertdelafuente.com-hugo-refined.git
    - name: nas
      url: ssh://nas/share/repos/gitlab.com:albertdelafuentecom:albertdelafuente.com-hugo-refined.git


groups:
  default:
    repos: []
  org:
    repos:
      - org
      - org-media

As you can see I have an "org" group which works when I sync with tsrc --verbose sync --group org -r org. Now I just added the last repo and I want to sync everything in the file. I thought of adding as default all the repos, which works, but... as I am adding more and more repos to the manifest I tend to forget to add them to the default group, so they are not part of the sync process.

I tried to use a general regex match like tsrc --verbose sync --group default -r .* but that didn't work. The behavior is "Workspace is empty", which kind of makes sense and kind of doesn't also depending on the point of view.

Possible solutions:

  • tsrc --verbose sync --group default -r .*. Allowing the regular expression . or .*
  • tsrc --verbose sync --group all (being the all name group a reserved name)
  • tsrc --verbose sync --all (a new flag for such purposes)

I hope it makes sense.

@dmerejkowsky
Copy link
Collaborator

I think --group all makes the most sense. We already have the concept of a "default" group.

Remember that we already have '--all-cloned' which does things slightly different than what you need.

Do you want to try and send a patch ?

@vonpupp
Copy link
Contributor Author

vonpupp commented Jul 7, 2022

Sure, I can try to submit a PR probably next week.

I thing --group --all would be better since it is not ambiguous in a scenario of a hypothetical all group existing. Otherwise we would have kind of a recursive situation, which is what brought me here in the first place. Would you agree with --group --all @dmerejkowsky?

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

No branches or pull requests

2 participants