goinstall: select the tag that is closest to runtime.Version
release.r50 looks for newest tag <= go.r50
weekly.2010-10-10 looks for newest tag <= go.2010-10-10
Implements behavior for hg, git, and bzr.
release.r50 looks for newest tag/branch <= go.r50 weekly.2010-10-10 looks for newest tag/branch <= go.2010-10-10 Implements ...
13 years, 8 months ago
(2011-08-22 01:34:57 UTC)
#3
release.r50 looks for newest tag/branch <= go.r50
weekly.2010-10-10 looks for newest tag/branch <= go.2010-10-10
Implements behavior for hg, git, and bzr.
Hg and bzr use tags. Git uses branches.
On Mon, Aug 22, 2011 at 11:34 AM, Andrew Gerrand <adg@golang.org> wrote: > release.r50 looks ...
13 years, 8 months ago
(2011-08-22 01:36:50 UTC)
#4
On Mon, Aug 22, 2011 at 11:34 AM, Andrew Gerrand <adg@golang.org> wrote:
> release.r50 looks for newest tag/branch <= go.r50
> weekly.2010-10-10 looks for newest tag/branch <= go.2010-10-10
>
> Implements behavior for hg, git, and bzr.
> Hg and bzr use tags. Git uses branches.
Why does git use branches for this? People might have a "weekly"
branch, but they wouldn't have a "go.2010-10-10" branch.
On 22 August 2011 11:36, David Symonds <dsymonds@golang.org> wrote: > On Mon, Aug 22, 2011 ...
13 years, 8 months ago
(2011-08-22 01:44:57 UTC)
#5
On 22 August 2011 11:36, David Symonds <dsymonds@golang.org> wrote:
> On Mon, Aug 22, 2011 at 11:34 AM, Andrew Gerrand <adg@golang.org> wrote:
>
>> release.r50 looks for newest tag/branch <= go.r50
>> weekly.2010-10-10 looks for newest tag/branch <= go.2010-10-10
>>
>> Implements behavior for hg, git, and bzr.
>> Hg and bzr use tags. Git uses branches.
>
> Why does git use branches for this? People might have a "weekly"
> branch, but they wouldn't have a "go.2010-10-10" branch.
Fixed as per our discussion.
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.go File src/cmd/goinstall/download.go (right): http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.go#newcode248 src/cmd/goinstall/download.go:248: tags := tagListRe.FindAllString(string(b), -1) If tags prints bongo.2011-01-01 then ...
13 years, 8 months ago
(2011-08-23 16:28:28 UTC)
#9
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.go
File src/cmd/goinstall/download.go (right):
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:248: tags := tagListRe.FindAllString(string(b),
-1)
If tags prints
bongo.2011-01-01
then this re is going to pull out 'go.2011-01-01'.
That's probably not a good idea. The output
should be split to produce the actual tag list,
and then you can filter based on
strings.HasPrefix(tag, "go.") or just pass them all
to selectTag and let it deal.
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:256: return run(dst, nil, v.cmd, v.checkout,
v.updateRevFlag+tag)
This should be v.updateRevFlag, tag.
Adding flag + value is not always reliable.
(It fails when value is empty.)
Tag isn't empty here but if you drop the +
you don't even have to think about it.
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:274: goPrefix := goPrefixRe.FindString(goVersion)
See Rob's blog post. :-)
if strings.HasPrefix(goVersion, "release.") {
...
}
if strings.HasPrefix(goVersion, "weekly.") {
...
}
They're different cases anyway. You can do weekly
with string comparison, but you can't do that for release,
or else release.r100 is going to break.
Thanks a lot for pushing this Andrew. Some minor points: http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.go File src/cmd/goinstall/download.go (right): http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.go#newcode49 ...
13 years, 8 months ago
(2011-08-24 00:25:27 UTC)
#10
13 years, 8 months ago
(2011-08-24 05:53:24 UTC)
#11
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.go
File src/cmd/goinstall/download.go (right):
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:246: return err
On 2011/08/24 00:25:27, niemeyer wrote:
> Might be good to capture Stderr and display it if non-empty and err != nil. It
> will certainly have useful hints about what failed.
Done.
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:248: tags := tagListRe.FindAllString(string(b),
-1)
On 2011/08/23 16:28:28, rsc wrote:
> If tags prints
>
> bongo.2011-01-01
>
> then this re is going to pull out 'go.2011-01-01'.
> That's probably not a good idea. The output
> should be split to produce the actual tag list,
> and then you can filter based on
> strings.HasPrefix(tag, "go.") or just pass them all
> to selectTag and let it deal.
>
Done.
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:256: return run(dst, nil, v.cmd, v.checkout,
v.updateRevFlag+tag)
On 2011/08/23 16:28:28, rsc wrote:
> This should be v.updateRevFlag, tag.
> Adding flag + value is not always reliable.
> (It fails when value is empty.)
> Tag isn't empty here but if you drop the +
> you don't even have to think about it.
I did this because in most cases (except bzr) the flag is empty. The rev is
never empty.
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:274: goPrefix := goPrefixRe.FindString(goVersion)
On 2011/08/23 16:28:28, rsc wrote:
> See Rob's blog post. :-)
>
> if strings.HasPrefix(goVersion, "release.") {
> ...
> }
> if strings.HasPrefix(goVersion, "weekly.") {
> ...
> }
>
> They're different cases anyway. You can do weekly
> with string comparison, but you can't do that for release,
> or else release.r100 is going to break.
Done.
http://codereview.appspot.com/4873057/diff/15002/src/cmd/goinstall/download.g...
src/cmd/goinstall/download.go:280: goVersion = goVersion[len(goPrefix):]
I changed a lot of variable names.
LGTM I haven't studied it closely, so wait for someone else's LGTM too. http://codereview.appspot.com/4873057/diff/11002/src/cmd/goinstall/download.go File ...
13 years, 8 months ago
(2011-08-26 05:30:09 UTC)
#14
http://codereview.appspot.com/4873057/diff/26001/src/cmd/goinstall/download.go File src/cmd/goinstall/download.go (right): http://codereview.appspot.com/4873057/diff/26001/src/cmd/goinstall/download.go#newcode274 src/cmd/goinstall/download.go:274: // selectTag returns the closest matching tag for a ...
13 years, 8 months ago
(2011-08-26 15:07:09 UTC)
#17
http://codereview.appspot.com/4873057/diff/26001/src/cmd/goinstall/doc.go File src/cmd/goinstall/doc.go (right): http://codereview.appspot.com/4873057/diff/26001/src/cmd/goinstall/doc.go#newcode97 src/cmd/goinstall/doc.go:97: When downloading or updating, goinstall looks for a tag ...
13 years, 8 months ago
(2011-08-28 22:59:54 UTC)
#18
*** Submitted as http://code.google.com/p/go/source/detail?r=db63f3a1f992 *** goinstall: select the tag that is closest to runtime.Version release.r50 ...
13 years, 8 months ago
(2011-08-29 23:37:30 UTC)
#20
Issue 4873057: code review 4873057: goinstall: select the tag that is closest to runtime.Version
(Closed)
Created 13 years, 8 months ago by adg
Modified 13 years, 8 months ago
Reviewers:
Base URL:
Comments: 33