]> Cypherpunks repositories - gostls13.git/commitdiff
vcs: Add support for git.openstack.org
authorMonty Taylor <mordred@inaugust.com>
Tue, 17 May 2016 13:24:18 +0000 (08:24 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 18 May 2016 14:11:33 +0000 (14:11 +0000)
Go is being proposed as an officially supported language for elements of
OpenStack:

  https://review.openstack.org/#/c/312267/

As such, repos that exist in OpenStack's git infrastructure
are likely to become places from which people might want to go get
things. Allow optional .git suffixes to allow writing code that depends
on git.openstack.org repos that will work with older go versions while
we wait for this support to roll out.

Change-Id: Ia64bdb1dafea33b1c3770803230d30ec1059df22
Reviewed-on: https://go-review.googlesource.com/23135
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/vcs.go
src/cmd/go/vcs_test.go

index 4ff71f216831252f454ad64d4d7b3f364d367a46..3b6e08f155b0e03c02ef539f53c766823abb424e 100644 (file)
@@ -848,6 +848,15 @@ var vcsPaths = []*vcsPath{
                repo:   "https://{root}",
        },
 
+       // Git at OpenStack
+       {
+               prefix: "git.openstack.org",
+               re:     `^(?P<root>git\.openstack\.org/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(\.git)?(/[A-Za-z0-9_.\-]+)*$`,
+               vcs:    "git",
+               repo:   "https://{root}",
+               check:  noVCSSuffix,
+       },
+
        // General syntax for any server.
        // Must be last.
        {
index d951189459870482d94a7dbc725d8542b43a329d..06650608ba40a84f0e15743c12a93c8d39b6d1f1 100644 (file)
@@ -86,6 +86,39 @@ func TestRepoRootForImportPath(t *testing.T) {
                        "hub.jazz.net/git/USER/pkgname",
                        nil,
                },
+               // OpenStack tests
+               {
+                       "git.openstack.org/openstack/swift",
+                       &repoRoot{
+                               vcs:  vcsGit,
+                               repo: "https://git.openstack.org/openstack/swift",
+                       },
+               },
+               // Trailing .git is less preferred but included for
+               // compatibility purposes while the same source needs to
+               // be compilable on both old and new go
+               {
+                       "git.openstack.org/openstack/swift.git",
+                       &repoRoot{
+                               vcs:  vcsGit,
+                               repo: "https://git.openstack.org/openstack/swift",
+                       },
+               },
+               {
+                       "git.openstack.org/openstack/swift/go/hummingbird",
+                       &repoRoot{
+                               vcs:  vcsGit,
+                               repo: "https://git.openstack.org/openstack/swift",
+                       },
+               },
+               {
+                       "git.openstack.org",
+                       nil,
+               },
+               {
+                       "git.openstack.org/openstack",
+                       nil,
+               },
                // Spaces are not valid in package name
                {
                        "git.apache.org/package name/path/to/lib",