File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,19 @@ git-open can automatically guess the corresponding repository page for remotes
98
98
99
99
#### GitLab support
100
100
101
- To configure GitLab support you need to set `gitopen.gitlab.domain`:
101
+ To configure GitLab support you need to set some options.
102
+
103
+ | option name | description | example |
104
+ | ------------------------- | ---------------------------------------------------------- | ------------------ |
105
+ | gitopen.gitlab.domain | The (web)domain name that will work for most of the people | gitlab.example.com |
106
+ | gitopen.gitlab.ssh.domain | A specific ssh domain name, *if needed* | git.example.com |
107
+ | gitopen.gitlab.ssh.port | A specific ssh port, *if needed* | 10022 |
102
108
103
109
```sh
104
110
# use --global to set across all repos, instead of just the local one
105
- git config [--global] gitopen.gitlab.domain [yourdomain.here]
111
+ git config [--global] gitopen.gitlab.domain [value]
112
+ git config [--global] gitopen.gitlab.ssh.domain [value]
113
+ git config [--global] gitopen.gitlab.ssh.port [value]
106
114
```
107
115
108
116
## Related projects / alternatives
Original file line number Diff line number Diff line change @@ -92,22 +92,24 @@ elif grep -q "/scm/" <<<$giturl; then
92
92
else
93
93
# custom GitLab
94
94
gitlab_domain=$( git config --get gitopen.gitlab.domain)
95
- gitlab_port=$( git config --get gitopen.gitlab.port)
95
+ gitlab_ssh_domain=$( git config --get gitopen.gitlab.ssh.domain)
96
+ gitlab_ssh_domain=${gitlab_ssh_domain:- $gitlab_domain }
97
+ gitlab_ssh_port=$( git config --get gitopen.gitlab.ssh.port)
96
98
if [ -n " $gitlab_domain " ]; then
97
- if grep -q " $gitlab_domain " <<< $giturl ; then
99
+ if egrep -q " ${ gitlab_domain} | ${gitlab_ssh_domain} " <<< $giturl ; then
98
100
99
101
# Handle GitLab's default SSH notation (like git@gitlab.domain.com:user/repo)
100
- giturl=${giturl/ git\@ ${gitlab_domain } \: / https:// ${gitlab_domain} / }
102
+ giturl=${giturl/ git\@ ${gitlab_ssh_domain } \: / https:// ${gitlab_domain} / }
101
103
102
104
# handle SSH protocol (links like ssh://git@gitlab.domain.com/user/repo)
103
105
giturl=${giturl/# ssh\:\/\/ / https:// }
104
106
105
107
# remove git@ from the domain
106
- giturl=${giturl/ git\@ ${gitlab_domain } / ${gitlab_domain} / }
108
+ giturl=${giturl/ git\@ ${gitlab_ssh_domain } / ${gitlab_domain} / }
107
109
108
110
# remove SSH port
109
- if [ -n " $gitlab_port " ]; then
110
- giturl=${giturl/ \/ : ${gitlab_port } \/ // }
111
+ if [ -n " $gitlab_ssh_port " ]; then
112
+ giturl=${giturl/ \/ : ${gitlab_ssh_port } \/ // }
111
113
fi
112
114
providerUrlDifference=tree
113
115
fi
You can’t perform that action at this time.
0 commit comments