Skip to content

feat: Allow basePath mapping to work with subdirectories (organizations, etc) #31

@IAmHughes

Description

@IAmHughes

When utilizing the basePath mapping, I found a gap in the feature making this extension less ideal for my use cases. GitHub, as well as many other VCS (GitLab, etc) utilize an owner/repo paradigm over each repository. For example, this repository is sourcegraph/sourcegraph-open-in-vs-code.

The problem with the basePath as is, is that it only looks for the repository name for the folder and will not search subdirectories. In OSS, often one must fork the repository from an organization that owns the codebase into their personal projects. Additionally, I have repositories that are owned by an org with the same name as repositories owned by myself as a user. For example, iamhughes/docs and microsoft/docs may both exist. If these are both cloned into the same basePath, the folder names would conflict and therefore I couldn't have both at the same time.

My personal solution in the past has always been for my directories to look something like the following tree:

github/
|- iamhughes/
   |- my-repo/
   |- ansible/
   |- sourcegraph-open-in-vs-code/
|- ansible/
   |- ansible/
|- sourcegraph/
   |- sourcegraph-open-in-vs-code/
   |- sourcegraph/
|- microsoft/
   |- cool-repo/
gitlab/
|- ...

I'm hoping we can add functionality to support this paradigm of retaining the <owner>/<repo> syntax in folder directories, specifying a base folder path of something like /Users/iamhughes/github/repos/* and it would search through the directories in repos to locate the proper one based on the owner of the repository.

Ideally, if we could do something like #25 with a "per platform" approach we could set basePath as a default as well as for specific code hosts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions