mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Merge pull request #50 from karlhorky/pedantic-uppercasing
Pedantically uppercase characters
This commit is contained in:
commit
6bba8cb0cd
14
README.md
14
README.md
|
|
@ -1,6 +1,6 @@
|
|||
# git-open
|
||||
|
||||
Type `git open` to open the repo website (Github, Gitlab, Bitbucket) in your browser.
|
||||
Type `git open` to open the repo website (GitHub, GitLab, Bitbucket) in your browser.
|
||||
|
||||

|
||||
|
||||
|
|
@ -8,10 +8,10 @@ Type `git open` to open the repo website (Github, Gitlab, Bitbucket) in your bro
|
|||
|
||||
```sh
|
||||
git open [remote-name] [branch-name]
|
||||
git open issue
|
||||
git open issue
|
||||
```
|
||||
|
||||
(`git open` works with these [hosted repo providers](#supported-remote-repositories), `git open issue` currently only works with Github)
|
||||
(`git open` works with these [hosted repo providers](#supported-remote-repositories), `git open issue` currently only works with GitHub)
|
||||
|
||||
### Examples
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ $ git open upstream master
|
|||
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/tree/master
|
||||
|
||||
$ git open issue
|
||||
# If branches use naming convention of issues/#123,
|
||||
# If branches use naming convention of issues/#123,
|
||||
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/issues/123
|
||||
```
|
||||
|
||||
|
|
@ -92,13 +92,13 @@ git-open can automatically guess the corresponding repository page for remotes
|
|||
- github.com
|
||||
- gist.github.com
|
||||
- gitlab.com
|
||||
- Gitlab custom hosted (see below)
|
||||
- GitLab custom hosted (see below)
|
||||
- bitbucket.org
|
||||
- Atlassian Bitbucket Server (formerly _Atlassian Stash_)
|
||||
|
||||
#### Gitlab support
|
||||
#### GitLab support
|
||||
|
||||
To configure gitlab support you need to set `gitopen.gitlab.domain`:
|
||||
To configure GitLab support you need to set `gitopen.gitlab.domain`:
|
||||
|
||||
```sh
|
||||
# use --global to set across all repos, instead of just the local one
|
||||
|
|
|
|||
14
git-open
14
git-open
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Opens the github page for a repo/branch in your browser.
|
||||
# Opens the GitHub page for a repo/branch in your browser.
|
||||
# https://github.com/paulirish/git-open/
|
||||
#
|
||||
# git open
|
||||
|
|
@ -54,12 +54,12 @@ fi
|
|||
branch=${branch//%/%25} && branch=${branch//#/%23}
|
||||
|
||||
# URL normalization
|
||||
# Github gists
|
||||
# GitHub gists
|
||||
if grep -q gist.github <<<$giturl; then
|
||||
giturl=${giturl/git\@gist.github\.com\:/https://gist.github.com}
|
||||
providerUrlDifference=tree
|
||||
|
||||
# Github
|
||||
# GitHub
|
||||
elif grep -q github <<<$giturl; then
|
||||
giturl=${giturl/git\@github\.com\:/https://github.com/}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ elif grep -q github <<<$giturl; then
|
|||
|
||||
providerUrlDifference=tree
|
||||
|
||||
# bitbucket
|
||||
# Bitbucket
|
||||
elif grep -q bitbucket <<<$giturl; then
|
||||
giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/}
|
||||
# handle SSH protocol (change ssh://https://bitbucket.org/user/repo to https://bitbucket.org/user/repo)
|
||||
|
|
@ -88,16 +88,16 @@ elif grep -q "/scm/" <<<$giturl; then
|
|||
branch="?at=refs%2Fheads%2F${branch}"
|
||||
fi
|
||||
|
||||
# Gitlab
|
||||
# GitLab
|
||||
else
|
||||
# custom gitlab
|
||||
# custom GitLab
|
||||
gitlab_domain=$(git config --get gitopen.gitlab.domain)
|
||||
if [ -n "$gitlab_domain" ]; then
|
||||
if grep -q "$gitlab_domain" <<<$giturl; then
|
||||
giturl=${giturl/git\@${gitlab_domain}:/https://${gitlab_domain}/}
|
||||
providerUrlDifference=tree
|
||||
fi
|
||||
# hosted gitlab
|
||||
# hosted GitLab
|
||||
elif grep -q gitlab <<<$giturl; then
|
||||
giturl=${giturl/git\@gitlab\.com\:/https://gitlab.com/}
|
||||
providerUrlDifference=tree
|
||||
|
|
|
|||
Loading…
Reference in a new issue