Skip to content

Allow passing the git remote arg when opening / copying URLs for GH #105

@lougreenwood

Description

@lougreenwood

In my work, the git remote which I use is a fork of the repo, so when I want to view the file in GH I don't necessarily want to view the file on the default origin remote since that corresponds to my fork. Instead I might want to treat my-company-name as the canonical upstream where I would want to share a link to (it's only in rare circumstances that I actually want to share a link to my fork).

Instead, it would be useful to allow passing an arg for the git remote to create the URL for, then I can have a keybinding for opening in using some other remote.

It could also be useful to define which remote to use by default on a per-git-project basis, maybe this could be a table allowing defining a glob pattern to match to a given project or collection of projects in a parent dir Something like:

'**/code/work/**' = { default_git_remote = 'my-company-name' },
'**/code/projects/**' = { default_git_remote = 'upstream' },

This would allow overriding globally using the default commands as well as further overriding for key bindings.

I started poking around and it seems that this is the line where the URL creation happens:

local remote_url_command = utils.make_local_command("git config --get remote.origin.url")

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions