Skip to content

Commit f0bcdd2

Browse files
authored
update readme for (gitlab) config (#99)
1 parent 7345179 commit f0bcdd2

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,28 @@ git-open can automatically guess the corresponding repository page for remotes
103103
- Visual Studio Team Services
104104
- Team Foundation Server (on-premises)
105105
106-
### GitLab support
106+
### Configuration (GitLab support)
107107
108-
To configure GitLab support you need to set some options.
108+
To configure GitLab support (or other unique hosting situations) you need to set some options.
109+
110+
| option name | description |
111+
| ------------------------- | ---------------- |
112+
| open.[gitdomain].domain | The (web) domain to open based on the provided git repo domain |
113+
| open.[gitdomain].protocol | The (web) protocol to open based on the provided git repo domain. (Defaults to `https`) |
109114
110-
| option name | description | example |
111-
| ------------------------- | ---------------------------------------------------------- | ------------------ |
112-
| gitopen.gitlab.domain | The (web)domain name that will work for most of the people | gitlab.example.com |
113-
| gitopen.gitlab.ssh.domain | A specific ssh domain name, *if needed* | git.example.com |
114-
| gitopen.gitlab.ssh.port | A specific ssh port, *if needed* | 10022 |
115115
116116
```sh
117-
# use --global to set across all repos, instead of just the local one
118-
git config [--global] gitopen.gitlab.domain [value]
119-
git config [--global] gitopen.gitlab.ssh.domain [value]
120-
git config [--global] gitopen.gitlab.ssh.port [value]
117+
git config [--global] open.[gitdomain].domain [value]
118+
git config [--global] open.[gitdomain].protocol [value]
121119
```
122120
123-
If your Gitlab custom hosted is serving `http` you can also specify this:
121+
**Example**
122+
* Your git remote is at `ssh://[email protected]:7000/XXX/YYY.git`
123+
* Your hosted gitlab is `http://repo.intranet/subpath/XXX/YYY`
124+
124125
```sh
125-
# use --global to set across all repos, instead of just the local one
126-
git config [--global] gitopen.gitlab.protocol http
126+
git config [--global] "open.https://git.internal.biz.domain" "repo.intranet/subpath"
127+
git config [--global] "open.https://git.internal.biz.protocol" "http"
127128
```
128129
129130
### Default remote

test/git-open.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,13 @@ setup() {
276276
@test "gitlab: default ssh origin style" {
277277
# https://github.com/paulirish/git-open/pull/55
278278
git remote set-url origin "[email protected]:user/repo"
279-
git config "gitopen.gitlab.domain" "gitlab.example.com"
280279
run ../git-open
281280
assert_output "https://gitlab.example.com/user/repo"
282281
}
283282

284283
@test "gitlab: ssh://git@ origin" {
285284
# https://github.com/paulirish/git-open/pull/51
286285
git remote set-url origin "ssh://[email protected]/user/repo"
287-
git config "gitopen.gitlab.domain" "gitlab.domain.com"
288286
run ../git-open
289287
assert_output "https://gitlab.domain.com/user/repo"
290288
refute_output --partial "//user"

0 commit comments

Comments
 (0)