Projects STRLCPY git-open Commits 4e3aa0ad
🤬
  • Add http protocol for Gitlab custom host (#60)

    * Add http protocol for Gitlab custom host
    
    * default to https
    
    * Revert "default to https"
    
    This reverts commit b25190b5d11945f73b97155d8ad23f9b7add981c.
    
    * Revert "Merge branch 'master' into http"
    
    This reverts commit 18573f8b29fa33ae1b948cf4eb7fee39c9d7067d, reversing
    changes made to 88a9e254aea74e1ba36734fada9b9d9abd9df9d9.
    
    * Revert "Revert "Merge branch 'master' into http""
    
    This reverts commit fa0e6d1f21e10113961fe94d99d597cdfdbc9adf.
    
    * Revert "Revert "default to https""
    
    This reverts commit d754476010f58e77aabafd6847921997a2f73fc2.
  • Loading...
  • Martin Delille committed with Paul Irish 7 years ago
    4e3aa0ad
    1 parent bbc50d70
  • ■ ■ ■ ■ ■ ■
    README.md
    skipped 112 lines
    113 113  git config [--global] gitopen.gitlab.ssh.port [value]
    114 114  ```
    115 115   
     116 +If your Gitlab custom hosted is serving `http` you can also specify this:
     117 +```sh
     118 +# use --global to set across all repos, instead of just the local one
     119 +git config [--global] gitopen.gitlab.protocol http
     120 +```
     121 + 
    116 122  ## Related projects / alternatives
    117 123   
    118 124  See [hub](https://github.com/github/hub) for complete GitHub opening support.
    skipped 39 lines
  • ■ ■ ■ ■ ■
    git-open
    skipped 94 lines
    95 95   gitlab_ssh_domain=$(git config --get gitopen.gitlab.ssh.domain)
    96 96   gitlab_ssh_domain=${gitlab_ssh_domain:-$gitlab_domain}
    97 97   gitlab_ssh_port=$(git config --get gitopen.gitlab.ssh.port)
    98  - if [ -n "$gitlab_domain" ]; then
     98 +
     99 + gitlab_protocol=$(git config --get gitopen.gitlab.protocol)
     100 + if [ -z "$gitlab_protocol" ]; then
     101 + gitlab_protocol=https
     102 + fi
     103 + 
     104 +if [ -n "$gitlab_domain" ]; then
    99 105   if egrep -q "${gitlab_domain}|${gitlab_ssh_domain}" <<<$giturl; then
    100 106   
    101 107   # Handle GitLab's default SSH notation (like [email protected]:user/repo)
    102  - giturl=${giturl/git\@${gitlab_ssh_domain}\:/https://${gitlab_domain}/}
     108 + giturl=${giturl/git\@${gitlab_ssh_domain}\:/${gitlab_protocol}://${gitlab_domain}/}
    103 109   
    104 110   # handle SSH protocol (links like ssh://[email protected]/user/repo)
    105  - giturl=${giturl/#ssh\:\/\//https://}
     111 + giturl=${giturl/#ssh\:\/\//${gitlab_protocol}://}
    106 112   
    107 113   # remove git@ from the domain
    108 114   giturl=${giturl/git\@${gitlab_ssh_domain}/${gitlab_domain}/}
    skipped 37 lines
Please wait...
Page is in error, reload to recover