Skip to content

--version argument in kup install doesn't disambiguate between paths and branch names #138

@lucasmt

Description

@lucasmt

When a user runs kup install ... --version ..., the --version argument can be either a branch name or a path. If there is both a branch and a local directory with the same name, kup interprets it as a path by default. This might lead to a user accidentally installing the wrong version without realizing.

For example, say that a user is in their local clone of the kontrol repo, and runs kup install kontrol --version feature, with the intention of installing the current version of the feature branch from the external repo. However, they forgot that they had a feature directory inside their local kontrol clone where they checked out feature (for example, with git worktree add feature) and made local changes that they didn't push to the external repo. kup install kontrol --version feature will actually interpret feature as the path to the local feature directory, rather than the name of the external feature branch. As a result, the version that is installed will be different than the one the user expects without them realizing.

Ideally, I think that if the --version argument can be interpreted both ways, it might be a good idea to warn the user and provide a way to allow them to disambiguate between the two, so that this mistake can be avoided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions