mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Add support for self-hosted Gitlab. Fixes #8.
This commit is contained in:
parent
3e92367414
commit
715a86f0ad
20
README.md
20
README.md
|
|
@ -27,6 +27,26 @@ curl -o ~/bin/git-open https://raw.githubusercontent.com/paulirish/git-open/mast
|
|||
chmod +x ~/bin/git-open
|
||||
```
|
||||
|
||||
|
||||
## Gitlab support
|
||||
To configure gitlab support you need to set gitopen.gitlab.domain:
|
||||
|
||||
```
|
||||
git config --global gitopen.gitlab.domain [yourdomain.here]
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
git config gitopen.gitlab.domain [yourdomain.here] in your local repository
|
||||
```
|
||||
|
||||
By default it goes to the tree view but can be changed to go to the commits view like so:
|
||||
|
||||
```
|
||||
git config gitopen.gitlab.urldifference commits
|
||||
```
|
||||
|
||||
## Thx
|
||||
@jasonmccreary did [all the hard work](https://github.com/jasonmccreary/gh)
|
||||
|
||||
|
|
|
|||
14
git-open
14
git-open
|
|
@ -61,6 +61,20 @@ elif grep -q "/scm/" <<<$giturl; then
|
|||
providerUrlDifference=browse
|
||||
branch="?at=refs%2Fheads%2F${branch}"
|
||||
fi
|
||||
else
|
||||
gitlab_domain=$(git config --get gitopen.gitlab.domain)
|
||||
if [ ! -z "$gitlab_domain" ]; then
|
||||
if grep -q $gitlab_domain <<<$giturl; then
|
||||
giturl=${giturl/git\@${gitlab_domain}:/https://${gitlab_domain}/}
|
||||
|
||||
gitlab_urldifference=$(git config --get gitopen.gitlab.urldifference)
|
||||
if [ -z "$gitlab_urldifference" ]; then
|
||||
providerUrlDifference=tree
|
||||
else
|
||||
providerUrlDifference=$gitlab_urldifference
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
giturl=${giturl%\.git}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue