Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

support remote names other than origin #59

@NikolausDemmel

Description

@NikolausDemmel

It seems like the remote name origin is hardcoded, e.g. here: https://github.com/vcstools/vcstools/blob/768f477a17e45cde8b57baed84e7661f601b73aa/src/vcstools/git.py#L155

I have checkouts where frequently the remote I want to use is not called origin. Sometimes the repo has multiple remotes (none called origin), sometimes I have one remote (not called origin).

I would suggest that wstool should dwim in those situtations, where user intent can be deduced.

E.g. a heuristic could be:

  1. if there is only one remote, use that, no matter what it is called
  2. if there are multiple remotes, and the local branch specified as the to-be-used version has a default remote, then use that remote
  3. otherwise, if one remote is called origin, use that
  4. otherwise, gracefully refuse service

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions