Commit graph

32 commits

Author SHA1 Message Date
Domenico Gemoli 0564817aef Adding a --commit option.
I've only tested this with gitlab seeing as I needed it there. If this could be useful I can integrate any feedback you might have to get this proposal merged.
2019-07-08 23:34:13 +02:00
Arunvel Sriram 8239d0a785 Add option to print the url 2019-07-03 21:32:34 +05:30
Love F 3d1ad212b2 default to upstream branch 2019-06-02 14:24:41 +02:00
Orestis Floros 8c8c41bd50
Support opening current tag / commit
Fixes #89.
Fixes #129.
2018-09-14 05:28:58 +03:00
Yohei TSUJI 2ef17f07d8 Added test cases for AWS Code Commit. 2018-08-10 15:56:21 +09:00
August Valera c3fd9a48df Revert gitignore package-lock, fix #115
Remove package-lock.json from gitignore for npm
Fix bug in #115 that modified user's gitconfig when running tests
2018-02-26 22:15:35 -08:00
Dave Wikoff d049d441b3
Merge pull request #114 from Jaxwood/master
Fix bug with open -i on default VSTS project repo
2018-02-21 20:37:32 -05:00
August Valera 8909a2b753 Adds support for sshconfig expansion
See `man ssh_config` for documentation for sshconfig.
Only works on SCP-like remote URL's [user@]hostalias:path/to/repo.git
Parses through ~/.ssh/config, looking for a Host entry matching
hostalias (bash-like pattern matching supported) and expanding it to the
corresponding HostName entry, if applicable.
2018-02-04 12:12:48 -08:00
Dave Wikoff 7449bfa7e1
Merge pull request #115 from larsks/feature/ls-url
Use ls-remote --get-url to get remote url
2018-02-04 12:06:54 -05:00
Lars Kellogg-Stedman 740222babf Use ls-remote --get-url to get remote url
As noted in a comment, 'git ls-remote --get-url' will expand insteadOf
mappings.  I use a number of shortcuts (like gh: for git on github,
lp: for git on launchpad, me: for my github repositories, etc), so I
was constantly hitting situations in which git-open would fail to do
the right thing.

It looks like '--get-url' has been available since git 2.12.0.
2018-02-02 10:41:54 -05:00
Jacob Lorenzen 67b72ac0f2 Fix bug with open -i on default VSTS project repo
The default VSTS clone url is different from other project repository urls

e.g. Default repository url: https://gitopen.visualstudio.com/_git/Project
     Sibling repository url: https://gitopen.visualstudio.com/Project/_git/Repository

     Trying to use git open -i on the default repository will lead to an
     url formatted as https://gitopen.visualstudio.com/_git/Project/_workitems?id=xx
     This url is malformed as the _git part should not be part of it.

     This change will fix this bug and correctly format url as
     https://gitopen.visualstudio.com/Project/_workitems?id=xx.
2018-01-24 13:41:02 +01:00
Nils Winkler 140edbbcee Fixed test names to match existing tests
Also removed some duplicated tests that were introduced during a
previous merge.
2018-01-11 08:18:42 +01:00
Nils Winkler 24dd2fc5fc Added support for Bitbucket Server with different root context
Please see the unit tests for more details. Basically, take the context
parts before 'scm' and add them to the new URL before the other parts.

Instead of taking fixed indexes for the path elements, base everything
off the index of the found 'scm' path element.
2018-01-09 09:21:01 +01:00
Paul Irish f0bcdd200a
update readme for (gitlab) config (#99) 2017-12-01 13:41:45 -08:00
Edward Thomson e3ce014bfa Add support for Visual Studio Team Services and Team Foundation Server (#93)
* Parse remotes as URLs or SCP-style paths

Instead of trying to strip on ':' and '/' to simplify a URL, actually
switch based on whether the remote path is a URL ("scheme://host:port/path")
or an SCP-style path (user@host:path) and parse them separately.

This allows us to handle custom ports in HTTP and HTTPS, but ignore
custom ports in an SSH url and HTTP remotes, instead of always upgrading
them to HTTPS.

* Introduce tests for Visual Studio Team Services

Add tests for Visual Studio Team Services (VSTS) and Team Foundation
Server (TFS).  VSTS suggests remote paths in two formats: HTTPS URLs
or SSH URLs (including port number).  TFS is an on-premises product
which - when running as an HTTP endpoint - defaults to port 8080.

* Branch selection in Visual Studio Team Services

VSTS and TFS URLs end in '/_git/RepositoryName` (with 0 or more leading
folders of hierarchy in front of that.)  Detect these from the `_git` in
the penultimate folder of the path.  Append branch information to VSTS
and TFS URLs.

Since VSTS and TFS use a query string to select a branch, instead of
including it in the server path, the `providerBranchRef` for other
services was changed to include the leading `/`, and now the `openurl`
and `providerBranchRef` are simply concatenated, to avoid an incorrect
trailing `/` for the VSTS and TFS branch URLs.

* Issues for Visual Studio Team Services

Provide issue support for VSTS and TFS, modifying the URL from the
`_git` endpoint to the `_workitems` endpoint and appending the `id`
query string.

* README: add VSTS and TFS support
2017-11-30 16:23:52 -08:00
Love F 363d054386 Git styled -h and --issue options (#94) 2017-10-31 16:15:50 -07:00
Paul Irish 07d75b2e1e
add test for bitbucket server (#83)
* add test for bitbucket server
* add branch test for bb server.
* updated assertions from discussion.
* remove 'git/' from test cases
2017-10-27 14:18:02 -07:00
Paul Irish fa49deeb17
default to tracked remote (#88) 2017-10-27 13:56:29 -07:00
Dave Wikoff e68eee6a44 Strip ports based on protocol properly. Adding config for custom domains and protocols. (#92) 2017-10-26 12:52:33 -07:00
Paul Irish 0a43af82ab skip failing tests temporarily. see #87 2017-06-21 13:27:34 -07:00
Paul Irish 06b74c4821 update test expectations 2017-06-21 10:04:55 -07:00
Paul Irish 494c54e1c6 test: safety check to confirm we're in the sandbox repo. 2017-06-20 18:42:38 -07:00
Paul Irish 2bb36a36cd git open issue: add assertion 2017-06-20 18:03:36 -07:00
Paul Irish 75ced59719 Merge branch 'master' into rewrite 2017-06-20 17:59:19 -07:00
Frank Fesevur 3f1d4e84b6 Not necessary anymore to skip the test 2017-06-20 17:57:52 -07:00
Paul Irish 21d370175d add tests for gitlab: ssh://git@host:port origin (#82) 2017-06-18 17:47:46 -07:00
Paul Irish 53e91d130b export BROWSER variable, and test that its set. 2017-06-18 17:14:31 -07:00
Dave Wikoff c2c7830514 Bitbucket server, and minor tweaks to BROWSER 2017-06-18 16:52:12 -07:00
Paul Irish fd8b0aa991 sandboxrepo: set origin url differently for git 2.12.1? 2017-06-18 16:43:54 -07:00
Paul Irish e4970897f8 update test expectations 2017-06-18 13:53:43 -07:00
Paul Irish b449cd0cbc Add BB sourceview tests from PR #26 (#81) 2017-06-18 13:38:43 -07:00
Paul Irish 927517adb9 Add a test suite (#78) 2017-06-16 15:57:49 -07:00