Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(150)

Issue 5306069: code review 5306069: goinstall: More intelligent vcs selection for common sites (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by quantumfyre
Modified:
13 years, 5 months ago
Reviewers:
rsc
CC:
golang-dev, adg
Visibility:
Public.

Description

goinstall: More intelligent vcs selection for common sites goinstall has built in support for a few common code hosting sites. The identification of which vcs tool should be used was based purely on a regex match against the provided import path. The problem with this approach is that it requires distinct import paths for different vcs tools on the same site. Since bitbucket has recently starting hosting Git repositories under the same bitbucket.org/user/project scheme as it already hosts Mercurial repositories, now would seem a good time to take a more flexible approach. We still match the import path against a list of regexes, but now the match is purely to distinguish the different hosting sites. Once the site is identified, the specified function is called with the repo and path matched out of the import string. This function is responsible for creating the vcsMatch structure that tells us what we need to download the code. For github and launchpad, only one vcs tool is currently supported, so these functions can simply return a vcsMatch structure. For googlecode, we retain the behaviour of determing the vcs from the import path - but now it is done by the function instead of the regex. For bitbucket, we use api.bitbucket.org to find out what sort of repository the specified import path corresponds to - and then construct the appropriate vcsMatch structure.

Patch Set 1 #

Patch Set 2 : diff -r 3fe4f3f34e9b https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 3fe4f3f34e9b https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 3fe4f3f34e9b https://go.googlecode.com/hg/ #

Total comments: 14

Patch Set 5 : diff -r 3fe4f3f34e9b https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -30 lines) Patch
M src/cmd/goinstall/doc.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/goinstall/download.go View 1 2 3 4 6 chunks +93 lines, -29 lines 0 comments Download

Messages

Total messages: 7
quantumfyre
Hello golang-dev@googlegroups.com (cc: adg@golang.org, golang-dev@googlegroups.com, rsc@golang.org), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 5 months ago (2011-10-26 22:56:13 UTC) #1
quantumfyre
Hello golang-dev@googlegroups.com (cc: adg@golang.org, golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 5 months ago (2011-10-26 23:06:31 UTC) #2
adg
I like this. http://codereview.appspot.com/5306069/diff/8001/src/cmd/goinstall/download.go File src/cmd/goinstall/download.go (right): http://codereview.appspot.com/5306069/diff/8001/src/cmd/goinstall/download.go#newcode127 src/cmd/goinstall/download.go:127: {regexp.MustCompile(`^([a-z0-9\-]+\.googlecode\.com/(svn|git|hg))(/[a-z0-9A-Z_.\-/]*)?$`), googleVcs}, please expand these lines ...
13 years, 5 months ago (2011-10-27 04:58:49 UTC) #3
quantumfyre
Hello golang-dev@googlegroups.com, adg@golang.org (cc: golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 5 months ago (2011-10-27 07:40:26 UTC) #4
adg
LGTM It would be nice to have some tests for this, but I think it's ...
13 years, 5 months ago (2011-10-27 08:44:04 UTC) #5
adg
*** Submitted as http://code.google.com/p/go/source/detail?r=69423942510b *** goinstall: More intelligent vcs selection for common sites goinstall has ...
13 years, 5 months ago (2011-10-27 08:45:14 UTC) #6
rsc
13 years, 5 months ago (2011-10-31 16:16:39 UTC) #7
Please add some tests, to make it less likely
that I will break this when moving it into "go".

Thanks.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b