paulirish / git-open

Type `git open` to open the GitHub page or website for a repository in your browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gitea and gogs support

yhan219 opened this issue · comments

If an incorrect URL is opened, please provide the following so we can write a test:

Example clone url:

https://www.mydomain.com/userName/projectName.git

Example branch name:

release

Expected web URL:

https://www.mydomain.com/userName/projectName/src/release

I assume you left the issue template as is?

Without providing all the possible types of git remote and the corresponding URL it is impossible to do anything about it.

But note that somebody has to do it. Apparently the main contributors to this project don't use those services so don't hold your breath 😉 And if you have the knowledge to do it yourself, we'll look at your PR.

Gitea and Gogs are open-source applications for self-hosting web-based git repositories and associated tools. Gitea is a fork of Gogs. Similar to self-hosted Gitlab. In some quick testing with the Gogs demo instance it seems like git-open will work out-of-the-box, except with branch URLs, which they format as https://subdomain.tld.io/username/repo/src/branch/name - so the 'src' vs 'tree' breaks things. Other than that, they should work, especially with the GitLab-oriented custom domain configuration.

Since all the URL adjustments are done based on the remote's URL currently, it seems like it would require a substantial refector to add this in, as you'd probably need a config element tied to the domain name to indicate gogs/gitea URLs instead of gitlab.

Added in #184