Commit Graph

9 Commits

Author SHA1 Message Date
Damien Neil
b0a944684d all: reformat with go1.19 gofmt
Apply go1.19 gofmt to non-generated files.

Generated .pb.go files are created by generate.bash using Go 1.18,
so leave them unchanged for now.

Change-Id: Ied36c83cf99704988d059bf0412e677f0fbc71b0
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/418676
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Lasse Folger <lassefolger@google.com>
2022-07-21 16:01:13 +00:00
Joe Tsai
4ab2bc9bb7 internal/version: move version information to internal package
Change-Id: I947876de5d290cf783d9ba798871725e77e16517
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223277
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-13 19:57:50 +00:00
Joe Tsai
a56bd81046 all: start v1.20.1-devel
Change-Id: Ie2940cd41fd3c449b2233e1bc3b6ba5ba91038f2
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222699
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 21:07:39 +00:00
Joe Tsai
290f718d07 all: release v1.20.1
Change-Id: I77c61b55d3c6aa540103ffe82c9dd226959bb753
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222698
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 21:07:25 +00:00
Damien Neil
969537aa29 all: start post-v1.20.0 devel
Change-Id: I811fab64a8a22288760beef04021ded63bc4ea9b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221784
Reviewed-by: Herbie Ong <herbie@google.com>
2020-03-02 19:36:27 +00:00
Damien Neil
aa81c06513 all: release v1.20.0
Change-Id: I3bc9d46f836535393059b9a73e8364211eee9e38
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221783
Reviewed-by: Herbie Ong <herbie@google.com>
2020-03-02 18:51:28 +00:00
Joe Tsai
fea7d5276d all: start v1.20.0-rc.1.devel
Change-Id: I7a88cf90c9b2ee61d6eae5019829362a7dce164f
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221598
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-29 07:48:10 +00:00
Joe Tsai
a6bf928d57 all: release v1.20.0-rc.1
Change-Id: I383cd3e94788f80b95f3ef7f1b86922fc0ea1db3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221597
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-29 07:47:16 +00:00
Joe Tsai
bab3d4084e runtime/protoimpl, cmd/protoc-gen-go: support release versioning
In order for protoc-gen-go to output the current version,
it needs to know what version it is currently running as.
However, we cannot rely on the git tags since the tags are not
made until *after* the commit has been submitted.
Instead, we manually encode the version into the code and
make sure that git tags match up with the version in the code.

The version.go file in runtime/protoimpl contains instructions
for how to make a release. Essentially:
* Every non-release commit has a version string with "devel" in it.
* Every release commit must not have "devel" in it and must be unique.
* The "release process" involves submitting two CLs.
The first CL creates a version string without "devel",
which is the commit that a git tag will actually reference.
The second CL follows immediately and re-introduces "devel"
into the version string.

The following example shows a possible sequence of VersionStrings
for git commits in time-ascending order:
	v1.19.0-devel      (this CL)
	v1.19.0-devel
	v1.19.0-devel
	v1.19.0-devel
	v1.20.0-rc.1       <- tagged
	v1.20.0-rc.1.devel
	v1.20.0-rc.1.devel
	v1.20.0-rc.1.devel
	v1.20.0-rc.2       <- tagged
	v1.20.0-rc.2.devel
	v1.20.0            <- tagged (future public release)
	v1.20.0-devel
	v1.20.0-devel
	v1.20.0-devel
	v1.20.0-devel
	v1.20.1            <- tagged
	v1.20.1-devel
	v1.20.1-devel
	v1.21.0            <- tagged
	v1.21.0-devel

Note that we start today with v1.19.0-devel, which means that our initial
release will be v1.20.0. This number was intentionally chosen since
1) the number 20 has some correlation to the fact that we keep calling
the new implementation the "v2" implementation, and
2) the set of tagged versions for github.com/golang/protobuf
and google.golang.org/protobuf are unlikely to ever overlap.
This way, the version of protoc-gen-go is never ambiguous which module
it was built from.

Now that we have version information, we add support for generating .pb.go
files with the version information recorded. However, we do not emit
these for .pb.go files in our own repository since they are always guaranteed
to be at the right version (enforced by integration_test.go).

Updates golang/protobuf#524

Change-Id: I25495a45042c2aa39a39cb7e7738ae8e831a9d26
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/186117
Reviewed-by: Damien Neil <dneil@google.com>
2019-08-07 22:59:30 +00:00