dirk-thomas/vcstool

Store multiple named remotes

Opened this issue · 2 comments

As I understand vcs is mainly used to replicate the set of currently tracked git (and others) repos.
I often use multiple remotes when working with forks to simplify rebasing on master. E.g. a remote origin pointing to the upstream projects and a remote fork pointing to my fork that contains feature branches.

When having the feature branch checked out, vcs will pick up the fork repo in the url. If I replicate this setup via vcs import on another PC, this fork url will be set to origin again and it will not create the upstream remote.
As a consequence:

  • the original upstream repo needs to be manually added to the second workspace (e.g. as remote upstream) to rebase on master
  • the remote names differ between workspaces, e.g. the original upstream repo will be either origin or upstream and the forked feature branch will be either fork/feature or origin/feature

It would be useful, if vcs would store multiple remotes as key-value pairs, e.g.:

url:
  origin: <url to upstream>
  fork: <url to fork>
version:
  - origin/master
  - fork/feature

That sounds like an interesting feature. Please consider contributing a pull request to implement this idea.

Better to use this form:

url:
  origin: <url to upstream>
  fork: <url to fork>
version:
  origin: master
  fork: feature

Because origin/master can be a legit git reference.